A million fixes in operations' cursor display. Oh gods I wake up in 4 am.

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@600 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud 2009-02-05 01:24:02 +00:00
parent 266145cd0a
commit ca2e12ff00
4 changed files with 44 additions and 28 deletions

View File

@ -445,7 +445,6 @@ byte Bouton_Quitter_Routine_locale(void)
Fenetre_aide(BOUTON_QUIT, NULL); Fenetre_aide(BOUTON_QUIT, NULL);
} }
while (Bouton_clicke<=0); while (Bouton_clicke<=0);
Attendre_fin_de_click();
Fermer_fenetre(); Fermer_fenetre();
Afficher_curseur(); Afficher_curseur();

28
init.c
View File

@ -1365,14 +1365,14 @@ void Initialisation_des_operations(void)
Ellipse_pleine_0_5,1); Ellipse_pleine_0_5,1);
Initialiser_operation(OPERATION_FILL,1,0, Initialiser_operation(OPERATION_FILL,1,0,
Fill_1_0,1); Fill_1_0,0);
Initialiser_operation(OPERATION_FILL,2,0, Initialiser_operation(OPERATION_FILL,2,0,
Fill_2_0,1); Fill_2_0,0);
Initialiser_operation(OPERATION_REMPLACER,1,0, Initialiser_operation(OPERATION_REMPLACER,1,0,
Remplacer_1_0,1); Remplacer_1_0,0);
Initialiser_operation(OPERATION_REMPLACER,2,0, Initialiser_operation(OPERATION_REMPLACER,2,0,
Remplacer_2_0,1); Remplacer_2_0,0);
Initialiser_operation(OPERATION_PRISE_BROSSE,1,0, Initialiser_operation(OPERATION_PRISE_BROSSE,1,0,
Brosse_12_0,1); Brosse_12_0,1);
@ -1431,9 +1431,9 @@ void Initialisation_des_operations(void)
Pipette_0_1,1); Pipette_0_1,1);
Initialiser_operation(OPERATION_LOUPE,1,0, Initialiser_operation(OPERATION_LOUPE,1,0,
Loupe_12_0,1); Loupe_12_0,0);
Initialiser_operation(OPERATION_LOUPE,2,0, Initialiser_operation(OPERATION_LOUPE,2,0,
Loupe_12_0,1); Loupe_12_0,0);
Initialiser_operation(OPERATION_COURBE_4_POINTS,1,0, Initialiser_operation(OPERATION_COURBE_4_POINTS,1,0,
Courbe_34_points_1_0,1); Courbe_34_points_1_0,1);
@ -1448,7 +1448,7 @@ void Initialisation_des_operations(void)
Initialiser_operation(OPERATION_COURBE_4_POINTS,1,9, Initialiser_operation(OPERATION_COURBE_4_POINTS,1,9,
Courbe_4_points_1_9,0); Courbe_4_points_1_9,0);
Initialiser_operation(OPERATION_COURBE_4_POINTS,2,9, Initialiser_operation(OPERATION_COURBE_4_POINTS,2,9,
Courbe_4_points_2_9,1); Courbe_4_points_2_9,0);
Initialiser_operation(OPERATION_COURBE_3_POINTS,1,0, Initialiser_operation(OPERATION_COURBE_3_POINTS,1,0,
Courbe_34_points_1_0,1); Courbe_34_points_1_0,1);
@ -1463,9 +1463,9 @@ void Initialisation_des_operations(void)
Initialiser_operation(OPERATION_COURBE_3_POINTS,0,11, Initialiser_operation(OPERATION_COURBE_3_POINTS,0,11,
Courbe_3_points_0_11,0); Courbe_3_points_0_11,0);
Initialiser_operation(OPERATION_COURBE_3_POINTS,1,11, Initialiser_operation(OPERATION_COURBE_3_POINTS,1,11,
Courbe_3_points_12_11,1); Courbe_3_points_12_11,0);
Initialiser_operation(OPERATION_COURBE_3_POINTS,2,11, Initialiser_operation(OPERATION_COURBE_3_POINTS,2,11,
Courbe_3_points_12_11,1); Courbe_3_points_12_11,0);
Initialiser_operation(OPERATION_SPRAY,1,0, Initialiser_operation(OPERATION_SPRAY,1,0,
Spray_1_0,0); Spray_1_0,0);
@ -1504,9 +1504,9 @@ void Initialisation_des_operations(void)
Initialiser_operation(OPERATION_POLYFILL,2,8, Initialiser_operation(OPERATION_POLYFILL,2,8,
Polyfill_12_8,0); Polyfill_12_8,0);
Initialiser_operation(OPERATION_POLYFILL,1,9, Initialiser_operation(OPERATION_POLYFILL,1,9,
Polyfill_12_9,1); Polyfill_12_9,0);
Initialiser_operation(OPERATION_POLYFILL,2,9, Initialiser_operation(OPERATION_POLYFILL,2,9,
Polyfill_12_9,1); Polyfill_12_9,0);
Initialiser_operation(OPERATION_POLYFILL,0,8, Initialiser_operation(OPERATION_POLYFILL,0,8,
Polyfill_0_8,1); Polyfill_0_8,1);
Initialiser_operation(OPERATION_POLYFILL,0,9, Initialiser_operation(OPERATION_POLYFILL,0,9,
@ -1567,9 +1567,9 @@ void Initialisation_des_operations(void)
Initialiser_operation(OPERATION_CERCLE_DEGRADE,0,6, Initialiser_operation(OPERATION_CERCLE_DEGRADE,0,6,
Cercle_degrade_0_6,1); Cercle_degrade_0_6,1);
Initialiser_operation(OPERATION_CERCLE_DEGRADE,1,8, Initialiser_operation(OPERATION_CERCLE_DEGRADE,1,8,
Cercle_degrade_12_8,1); Cercle_degrade_12_8,0);
Initialiser_operation(OPERATION_CERCLE_DEGRADE,2,8, Initialiser_operation(OPERATION_CERCLE_DEGRADE,2,8,
Cercle_degrade_12_8,1); Cercle_degrade_12_8,0);
Initialiser_operation(OPERATION_CERCLE_DEGRADE,0,8, Initialiser_operation(OPERATION_CERCLE_DEGRADE,0,8,
Cercle_ou_ellipse_degrade_0_8,0); Cercle_ou_ellipse_degrade_0_8,0);
@ -1596,7 +1596,7 @@ void Initialisation_des_operations(void)
Initialiser_operation(OPERATION_RECTANGLE_DEGRADE,0,7,Rectangle_Degrade_0_7,0); Initialiser_operation(OPERATION_RECTANGLE_DEGRADE,0,7,Rectangle_Degrade_0_7,0);
Initialiser_operation(OPERATION_RECTANGLE_DEGRADE,1,7,Rectangle_Degrade_12_7,1); Initialiser_operation(OPERATION_RECTANGLE_DEGRADE,1,7,Rectangle_Degrade_12_7,1);
Initialiser_operation(OPERATION_RECTANGLE_DEGRADE,1,9,Rectangle_Degrade_12_9,1); Initialiser_operation(OPERATION_RECTANGLE_DEGRADE,1,9,Rectangle_Degrade_12_9,1);
Initialiser_operation(OPERATION_RECTANGLE_DEGRADE,0,9,Rectangle_Degrade_0_9,1); Initialiser_operation(OPERATION_RECTANGLE_DEGRADE,0,9,Rectangle_Degrade_0_9,0);
Initialiser_operation(OPERATION_LIGNES_CENTREES,1,0, Initialiser_operation(OPERATION_LIGNES_CENTREES,1,0,

View File

@ -724,7 +724,6 @@ void Loupe_12_0(void)
// Souris effacée: Oui // Souris effacée: Oui
{ {
Attendre_fin_de_click();
// On passe en mode loupe // On passe en mode loupe
Loupe_Mode=1; Loupe_Mode=1;
@ -762,6 +761,8 @@ void Loupe_12_0(void)
// On fait de notre mieux pour restaurer l'ancienne opération: // On fait de notre mieux pour restaurer l'ancienne opération:
Demarrer_pile_operation(Operation_avant_interruption); Demarrer_pile_operation(Operation_avant_interruption);
Afficher_curseur();
Attendre_fin_de_click();
} }
/////////////////////////////////////////////////// OPERATION_RECTANGLE_????? /////////////////////////////////////////////////// OPERATION_RECTANGLE_?????
@ -1284,12 +1285,14 @@ void Fill_1_0(void)
// Souris effacée: Oui // Souris effacée: Oui
// //
{ {
Effacer_curseur();
// Pas besoin d'initialiser le début d'opération car le Smear n'affecte pas // Pas besoin d'initialiser le début d'opération car le Smear n'affecte pas
// le Fill, et on se fout de savoir si on est dans la partie gauche ou // le Fill, et on se fout de savoir si on est dans la partie gauche ou
// droite de la loupe. // droite de la loupe.
// On ne s'occupe pas de faire un Backup: c'est "Remplir" qui s'en charge. // On ne s'occupe pas de faire un Backup: c'est "Remplir" qui s'en charge.
Shade_Table=Shade_Table_gauche; Shade_Table=Shade_Table_gauche;
Remplir(Fore_color); Remplir(Fore_color);
Afficher_curseur();
Attendre_fin_de_click(); Attendre_fin_de_click();
} }
@ -1303,12 +1306,14 @@ void Fill_2_0(void)
// Souris effacée: Oui // Souris effacée: Oui
// //
{ {
Effacer_curseur();
// Pas besoin d'initialiser le début d'opération car le Smear n'affecte pas // Pas besoin d'initialiser le début d'opération car le Smear n'affecte pas
// le Fill, et on se fout de savoir si on est dans la partie gauche ou // le Fill, et on se fout de savoir si on est dans la partie gauche ou
// droite de la loupe. // droite de la loupe.
// On ne s'occupe pas de faire un Backup: c'est "Remplir" qui s'en charge. // On ne s'occupe pas de faire un Backup: c'est "Remplir" qui s'en charge.
Shade_Table=Shade_Table_droite; Shade_Table=Shade_Table_droite;
Remplir(Back_color); Remplir(Back_color);
Afficher_curseur();
Attendre_fin_de_click(); Attendre_fin_de_click();
} }
@ -1325,12 +1330,14 @@ void Remplacer_1_0(void)
// Souris effacée: Oui // Souris effacée: Oui
// //
{ {
Effacer_curseur();
// Pas besoin d'initialiser le début d'opération car le Smear n'affecte pas // Pas besoin d'initialiser le début d'opération car le Smear n'affecte pas
// le Replace, et on se fout de savoir si on est dans la partie gauche ou // le Replace, et on se fout de savoir si on est dans la partie gauche ou
// droite de la loupe. // droite de la loupe.
Backup(); Backup();
// Shade_Table=Shade_Table_gauche; // Shade_Table=Shade_Table_gauche;
Remplacer(Fore_color); Remplacer(Fore_color);
Afficher_curseur();
Attendre_fin_de_click(); Attendre_fin_de_click();
} }
@ -1344,12 +1351,14 @@ void Remplacer_2_0(void)
// Souris effacée: Oui // Souris effacée: Oui
// //
{ {
Effacer_curseur();
// Pas besoin d'initialiser le début d'opération car le Smear n'affecte pas // Pas besoin d'initialiser le début d'opération car le Smear n'affecte pas
// le Replace, et on se fout de savoir si on est dans la partie gauche ou // le Replace, et on se fout de savoir si on est dans la partie gauche ou
// droite de la loupe. // droite de la loupe.
Backup(); Backup();
// Shade_Table=Shade_Table_droite; // Shade_Table=Shade_Table_droite;
Remplacer(Back_color); Remplacer(Back_color);
Afficher_curseur();
Attendre_fin_de_click(); Attendre_fin_de_click();
} }
@ -1840,6 +1849,8 @@ void Courbe_4_points_2_9(void)
Operation_POP(&X1); Operation_POP(&X1);
Operation_POP(&Couleur); Operation_POP(&Couleur);
Effacer_curseur();
Courbe_Tracer_croix(X2,Y2); Courbe_Tracer_croix(X2,Y2);
Courbe_Tracer_croix(X3,Y3); Courbe_Tracer_croix(X3,Y3);
@ -1849,6 +1860,7 @@ void Courbe_4_points_2_9(void)
Effacer_courbe_Preview(X1,Y1,X2,Y2,X3,Y3,X4,Y4,Couleur); Effacer_courbe_Preview(X1,Y1,X2,Y2,X3,Y3,X4,Y4,Couleur);
Tracer_courbe_Definitif(X1,Y1,X2,Y2,X3,Y3,X4,Y4,Couleur); Tracer_courbe_Definitif(X1,Y1,X2,Y2,X3,Y3,X4,Y4,Couleur);
Afficher_curseur();
Attendre_fin_de_click(); Attendre_fin_de_click();
} }
@ -1996,11 +2008,14 @@ void Courbe_3_points_12_11(void)
Operation_POP(&Couleur); Operation_POP(&Couleur);
Cacher_pinceau=0; Cacher_pinceau=0;
Effacer_curseur();
Effacer_courbe_Preview (X1,Y1,X2,Y2,X3,Y3,X4,Y4,Couleur); Effacer_courbe_Preview (X1,Y1,X2,Y2,X3,Y3,X4,Y4,Couleur);
Calculer_courbe_3_points(X1,Y1,X4,Y4,&X2,&Y2,&X3,&Y3); Calculer_courbe_3_points(X1,Y1,X4,Y4,&X2,&Y2,&X3,&Y3);
Tracer_courbe_Definitif(X1,Y1,X2,Y2,X3,Y3,X4,Y4,Couleur); Tracer_courbe_Definitif(X1,Y1,X2,Y2,X3,Y3,X4,Y4,Couleur);
Afficher_curseur();
Attendre_fin_de_click(); Attendre_fin_de_click();
} }
@ -2364,15 +2379,12 @@ void Polyfill_12_9(void)
{ {
// La série de lignes est terminée, il faut donc effacer la dernière // La série de lignes est terminée, il faut donc effacer la dernière
// preview de ligne et relier le dernier point avec le premier // preview de ligne et relier le dernier point avec le premier
Effacer_curseur();
Tracer_ligne_Preview_xor(Debut_X,Debut_Y,Fin_X,Fin_Y,0); Tracer_ligne_Preview_xor(Debut_X,Debut_Y,Fin_X,Fin_Y,0);
Operation_POP(&Fin_Y); Operation_POP(&Fin_Y);
Operation_POP(&Fin_X); Operation_POP(&Fin_X);
Tracer_ligne_Preview_xor(Debut_X,Debut_Y,Fin_X,Fin_Y,0); Tracer_ligne_Preview_xor(Debut_X,Debut_Y,Fin_X,Fin_Y,0);
Afficher_curseur();
Attendre_fin_de_click();
Effacer_curseur();
Afficher_ecran(); Afficher_ecran();
Polyfill(Polyfill_Nombre_de_points,Polyfill_Table_de_points,Couleur); Polyfill(Polyfill_Nombre_de_points,Polyfill_Table_de_points,Couleur);
free(Polyfill_Table_de_points); free(Polyfill_Table_de_points);
@ -2384,6 +2396,9 @@ void Polyfill_12_9(void)
} }
Cacher_pinceau=0; Cacher_pinceau=0;
Afficher_curseur();
Attendre_fin_de_click();
} }
} }
@ -2485,7 +2500,6 @@ void Polyform_12_8(void)
Operation_POP(&Initial_Y); Operation_POP(&Initial_Y);
Operation_POP(&Initial_X); Operation_POP(&Initial_X);
Attendre_fin_de_click();
Effacer_curseur(); Effacer_curseur();
Print_coordonnees(); Print_coordonnees();
@ -2496,6 +2510,7 @@ void Polyform_12_8(void)
Tracer_ligne_Definitif(Debut_X,Debut_Y,Initial_X,Initial_Y,Couleur); Tracer_ligne_Definitif(Debut_X,Debut_Y,Initial_X,Initial_Y,Couleur);
Afficher_curseur(); Afficher_curseur();
Attendre_fin_de_click();
} }
} }
@ -2690,7 +2705,6 @@ void Filled_polyform_12_8(void)
Operation_POP(&Initial_Y); Operation_POP(&Initial_Y);
Operation_POP(&Initial_X); Operation_POP(&Initial_X);
Attendre_fin_de_click();
Effacer_curseur(); Effacer_curseur();
Print_coordonnees(); Print_coordonnees();
@ -2704,6 +2718,7 @@ void Filled_polyform_12_8(void)
Cacher_pinceau=0; Cacher_pinceau=0;
Afficher_curseur(); Afficher_curseur();
Attendre_fin_de_click();
} }
} }
@ -2773,7 +2788,6 @@ void Filled_contour_0_8(void)
Operation_POP(&Initial_Y); Operation_POP(&Initial_Y);
Operation_POP(&Initial_X); Operation_POP(&Initial_X);
Attendre_fin_de_click();
Effacer_curseur(); Effacer_curseur();
Print_coordonnees(); Print_coordonnees();
@ -3053,7 +3067,6 @@ void Polybrosse_12_8(void)
Operation_POP(&Initial_Y); Operation_POP(&Initial_Y);
Operation_POP(&Initial_X); Operation_POP(&Initial_X);
Attendre_fin_de_click();
Effacer_curseur(); Effacer_curseur();
Print_coordonnees(); Print_coordonnees();
@ -3080,6 +3093,7 @@ void Polybrosse_12_8(void)
// Comme l'enclenchement du bouton efface le curseur, il faut l'afficher au // Comme l'enclenchement du bouton efface le curseur, il faut l'afficher au
// préalable: // préalable:
Afficher_curseur(); Afficher_curseur();
Attendre_fin_de_click();
// !!! Efface la croix puis affiche le viseur !!! // !!! Efface la croix puis affiche le viseur !!!
Enclencher_bouton(BOUTON_DESSIN,A_GAUCHE); // Désenclenche au passage le bouton brosse Enclencher_bouton(BOUTON_DESSIN,A_GAUCHE); // Désenclenche au passage le bouton brosse
if (Config.Auto_discontinuous) if (Config.Auto_discontinuous)
@ -3429,8 +3443,8 @@ void Tourner_brosse_12_0(void)
} }
else else
{ {
Attendre_fin_de_click();
Demarrer_pile_operation(Operation_avant_interruption); Demarrer_pile_operation(Operation_avant_interruption);
Attendre_fin_de_click(); // FIXME: celui-la il donne un résultat pas très chouette en visuel
} }
} }
@ -3937,7 +3951,8 @@ void Cercle_degrade_12_8(void)
Operation_POP(&Centre_X); Operation_POP(&Centre_X);
Operation_POP(&Couleur); Operation_POP(&Couleur);
Operation_POP(&Ancien_Mouse_K); Operation_POP(&Ancien_Mouse_K);
Effacer_curseur();
// On efface la croix XOR au centre du cercle // On efface la croix XOR au centre du cercle
Courbe_Tracer_croix(Centre_X,Centre_Y); Courbe_Tracer_croix(Centre_X,Centre_Y);
@ -3952,6 +3967,7 @@ void Cercle_degrade_12_8(void)
if (Mouse_K==Ancien_Mouse_K) if (Mouse_K==Ancien_Mouse_K)
Tracer_cercle_degrade(Centre_X,Centre_Y,Rayon,Pinceau_X,Pinceau_Y); Tracer_cercle_degrade(Centre_X,Centre_Y,Rayon,Pinceau_X,Pinceau_Y);
Afficher_curseur();
Attendre_fin_de_click(); Attendre_fin_de_click();
if ((Config.Coords_rel) && (Menu_visible)) if ((Config.Coords_rel) && (Menu_visible))
@ -4500,6 +4516,7 @@ void Rectangle_Degrade_0_9(void)
Operation_POP(&Rect_Debut_X); Operation_POP(&Rect_Debut_X);
Operation_Taille_pile --; Operation_Taille_pile --;
Effacer_curseur();
// Maintenant on efface tout le bazar temporaire : rectangle et ligne XOR // Maintenant on efface tout le bazar temporaire : rectangle et ligne XOR
Effacer_ligne_Preview(Vecteur_Debut_X,Vecteur_Debut_Y,Vecteur_Fin_X,Vecteur_Fin_Y); Effacer_ligne_Preview(Vecteur_Debut_X,Vecteur_Debut_Y,Vecteur_Fin_X,Vecteur_Fin_Y);
@ -4507,6 +4524,7 @@ void Rectangle_Degrade_0_9(void)
// if (Mouse_K==Ancien_Mouse_K) // TODO sauver l'ancien mouse K à la place de la couleur dans l'étape 1. Modifier aussi les autres étapes pour pouvoir annuler à tout moment. // if (Mouse_K==Ancien_Mouse_K) // TODO sauver l'ancien mouse K à la place de la couleur dans l'étape 1. Modifier aussi les autres étapes pour pouvoir annuler à tout moment.
Tracer_rectangle_degrade(Rect_Debut_X,Rect_Debut_Y,Rect_Fin_X,Rect_Fin_Y,Vecteur_Debut_X,Vecteur_Debut_Y,Vecteur_Fin_X,Vecteur_Fin_Y); Tracer_rectangle_degrade(Rect_Debut_X,Rect_Debut_Y,Rect_Fin_X,Rect_Fin_Y,Vecteur_Debut_X,Vecteur_Debut_Y,Vecteur_Fin_X,Vecteur_Fin_Y);
Afficher_curseur();
Attendre_fin_de_click(); Attendre_fin_de_click();
if ((Config.Coords_rel) && (Menu_visible)) if ((Config.Coords_rel) && (Menu_visible))
@ -4660,7 +4678,6 @@ void Lignes_centrees_12_7(void)
} }
Afficher_curseur(); Afficher_curseur();
Attendre_fin_de_click(); Attendre_fin_de_click();
} }
} }

View File

@ -361,7 +361,6 @@ short Attendre_click_dans_shade()
Case_choisie=512; // valeur indiquant que l'on n'a rien choisi Case_choisie=512; // valeur indiquant que l'on n'a rien choisi
} }
Attendre_fin_de_click();
Effacer_curseur(); Effacer_curseur();
Forme_curseur=FORME_CURSEUR_FLECHE; Forme_curseur=FORME_CURSEUR_FLECHE;
Cacher_curseur=Ancien_Cacher_curseur; Cacher_curseur=Ancien_Cacher_curseur;
@ -796,6 +795,7 @@ int Menu_Shade(void)
Afficher_tout_le_shade(Premiere_couleur,Derniere_couleur,Select_Debut,Select_Fin); Afficher_tout_le_shade(Premiere_couleur,Derniere_couleur,Select_Debut,Select_Fin);
Afficher_curseur(); Afficher_curseur();
} }
Attendre_fin_de_click();
break; break;
case 13 : // Set (disable) case 13 : // Set (disable)