From b73d8b03dc589bce7f560e54ea5f987a5f47c915 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Sat, 10 Jan 2009 17:28:38 +0000 Subject: [PATCH] The Spray tool no longer lags when you use a >0 delay setting. Delay is now expressed in 1/100s, with range 0-99 git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@470 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- boutons.c | 4 ++-- graph.c | 3 --- operatio.c | 11 +++++++++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/boutons.c b/boutons.c index 49f68262..3f9f9c04 100644 --- a/boutons.c +++ b/boutons.c @@ -4910,9 +4910,9 @@ void Bouton_Spray_Menu(void) Readline(196,39,Chaine,2,1); Spray_Delay=atoi(Chaine); // On corrige le delai - if (Spray_Delay>10) + if (Spray_Delay>99) { - Spray_Delay=10; + Spray_Delay=99; Num2str(Spray_Delay,Chaine,2); Fenetre_Contenu_bouton_saisie(Saisie_Delay,Chaine); } diff --git a/graph.c b/graph.c index e3b56048..4591c135 100644 --- a/graph.c +++ b/graph.c @@ -1534,9 +1534,6 @@ void Aerographe(short Bouton_clicke) } Afficher_curseur(); - - for (Count=1; Count<=Spray_Delay; Count++) - Wait_VBL(); } diff --git a/operatio.c b/operatio.c index 35845745..fdeb0f44 100644 --- a/operatio.c +++ b/operatio.c @@ -2007,7 +2007,7 @@ void Courbe_3_points_12_11(void) ///////////////////////////////////////////////////////////// OPERATION_SPRAY - +Uint32 Spray_next_time; void Spray_1_0(void) // // Opération : OPERATION_SPRAY @@ -2020,6 +2020,8 @@ void Spray_1_0(void) Initialiser_debut_operation(); Backup(); Shade_Table=Shade_Table_gauche; + + Spray_next_time = SDL_GetTicks()+Spray_Delay*10; Aerographe(A_GAUCHE); Operation_PUSH(Pinceau_X); @@ -2039,6 +2041,7 @@ void Spray_2_0(void) Initialiser_debut_operation(); Backup(); Shade_Table=Shade_Table_droite; + Spray_next_time = SDL_GetTicks()+Spray_Delay*10; Aerographe(A_DROITE); Operation_PUSH(Pinceau_X); @@ -2069,7 +2072,11 @@ void Spray_12_3(void) Afficher_curseur(); } - Aerographe(Bouton_clicke); + if (SDL_GetTicks()>Spray_next_time) + { + Spray_next_time+=Spray_Delay*10; + Aerographe(Bouton_clicke); + } Operation_PUSH(Pinceau_X); Operation_PUSH(Pinceau_Y);