Correct handling of multi-button for spray and freehand.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@579 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
parent
0b2bbacf37
commit
c0b95295ae
@ -1,4 +1,3 @@
|
||||
$(OBJDIR)/SFont.o: SFont.c SFont.h
|
||||
$(OBJDIR)/aide.o: aide.c const.h struct.h global.h divers.h graph.h moteur.h \
|
||||
tables_aide.h aide.h sdlscreen.h texte.h clavier.h windows.h
|
||||
$(OBJDIR)/boutons.o: boutons.c const.h struct.h global.h divers.h graph.h moteur.h \
|
||||
@ -32,7 +31,7 @@ $(OBJDIR)/main.o: main.c const.h struct.h global.h graph.h divers.h init.h \
|
||||
$(OBJDIR)/moteur.o: moteur.c const.h struct.h global.h graph.h divers.h special.h \
|
||||
boutons.h operatio.h shade.h erreurs.h sdlscreen.h windows.h brush.h \
|
||||
input.h
|
||||
$(OBJDIR)/mountlist.o: mountlist.c
|
||||
$(OBJDIR)/mountlist.o: mountlist.c mountlist.h
|
||||
$(OBJDIR)/op_c.o: op_c.c op_c.h struct.h const.h erreurs.h graph.h
|
||||
$(OBJDIR)/operatio.o: operatio.c const.h struct.h global.h divers.h moteur.h \
|
||||
graph.h operatio.h boutons.h pages.h erreurs.h sdlscreen.h brush.h \
|
||||
@ -55,6 +54,7 @@ $(OBJDIR)/saveini.o: saveini.c const.h global.h struct.h readini.h io.h erreurs.
|
||||
$(OBJDIR)/sdlscreen.o: sdlscreen.c global.h struct.h const.h sdlscreen.h erreurs.h \
|
||||
graph.h divers.h
|
||||
$(OBJDIR)/setup.o: setup.c struct.h const.h io.h files.h
|
||||
$(OBJDIR)/SFont.o: SFont.c SFont.h
|
||||
$(OBJDIR)/shade.o: shade.c global.h struct.h const.h graph.h moteur.h divers.h \
|
||||
readline.h aide.h sdlscreen.h windows.h input.h
|
||||
$(OBJDIR)/special.o: special.c const.h struct.h global.h graph.h moteur.h windows.h
|
||||
|
||||
5
global.h
5
global.h
@ -115,7 +115,10 @@ GFX2_GLOBAL struct Composantes Coul_menu_pref[4];
|
||||
|
||||
GFX2_GLOBAL word Mouse_X; // Abscisse de la souris
|
||||
GFX2_GLOBAL word Mouse_Y; // Ordonnée de la souris
|
||||
GFX2_GLOBAL byte Mouse_K; // Etat des boutons de la souris
|
||||
GFX2_GLOBAL byte Mouse_K; // Etat des boutons de la souris (tient comte des boutons appuyés simultanéments
|
||||
|
||||
#define Mouse_K_Unique (Mouse_K==0?0:(Mouse_K&1?1:(Mouse_K&2?2:0))) // Etat des boutons de la souris (un seul bouton à la fois, on regarde d'abord le 1, puis le 2, ...)
|
||||
|
||||
GFX2_GLOBAL dword Touche; // Touche tapée
|
||||
GFX2_GLOBAL dword Touche_ANSI; // Caractère tapé
|
||||
GFX2_GLOBAL Uint8* Etat_Du_Clavier; // Scancode de la touche en cours et etat des touches de ctrl
|
||||
|
||||
12
init.c
12
init.c
@ -1471,12 +1471,12 @@ void Initialisation_des_operations(void)
|
||||
Spray_1_0,0);
|
||||
Initialiser_operation(OPERATION_SPRAY,2,0,
|
||||
Spray_2_0,0);
|
||||
Initialiser_operation(OPERATION_SPRAY,1,3,
|
||||
Spray_12_3,0);
|
||||
Initialiser_operation(OPERATION_SPRAY,2,3,
|
||||
Spray_12_3,0);
|
||||
Initialiser_operation(OPERATION_SPRAY,0,3,
|
||||
Spray_0_3,0);
|
||||
Initialiser_operation(OPERATION_SPRAY,1,2,
|
||||
Spray_12_2,0);
|
||||
Initialiser_operation(OPERATION_SPRAY,2,2,
|
||||
Spray_12_2,0);
|
||||
Initialiser_operation(OPERATION_SPRAY,0,2,
|
||||
Spray_0_2,0);
|
||||
|
||||
Initialiser_operation(OPERATION_POLYGONE,1,0,
|
||||
Polygone_12_0,1);
|
||||
|
||||
7
input.c
7
input.c
@ -329,12 +329,12 @@ int Get_input(void)
|
||||
SDL_Event event;
|
||||
int User_Feedback_Required = 0; // Flag qui indique si on doit arrêter de traiter les évènements ou si on peut enchainer
|
||||
|
||||
/*Touche =*/ Touche_ANSI = 0;
|
||||
Touche_ANSI = 0;
|
||||
|
||||
// Process as much events as possible without redrawing the screen.
|
||||
// This mostly allows us to merge mouse events for people with an high
|
||||
// resolution mouse
|
||||
while( (!User_Feedback_Required) && SDL_PollEvent(&event))
|
||||
while( (!User_Feedback_Required) && SDL_PollEvent(&event)) // Try to cumulate for a full VBL except if there is a required feedback
|
||||
{
|
||||
switch(event.type)
|
||||
{
|
||||
@ -349,7 +349,7 @@ int Get_input(void)
|
||||
break;
|
||||
|
||||
case SDL_MOUSEMOTION:
|
||||
User_Feedback_Required = Handle_Mouse_Move(&event); // On ne sort que si la souris a vraiment bougé
|
||||
User_Feedback_Required = Handle_Mouse_Move(&event);
|
||||
break;
|
||||
|
||||
case SDL_MOUSEBUTTONDOWN:
|
||||
@ -385,7 +385,6 @@ int Get_input(void)
|
||||
break;
|
||||
}
|
||||
}
|
||||
// DEBUG("Exiting event loop",0);
|
||||
|
||||
// Vidage de toute mise à jour de l'affichage à l'écran qui serait encore en attente.
|
||||
// (c'est fait ici car on est sur que cette fonction est apellée partout ou on a besoin d'interragir avec l'utilisateur)
|
||||
|
||||
10
moteur.c
10
moteur.c
@ -1049,12 +1049,11 @@ void Gestion_principale(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Blink=Operation[Operation_en_cours][Mouse_K][Operation_Taille_pile].Effacer_curseur;
|
||||
Blink=Operation[Operation_en_cours][Mouse_K_Unique][Operation_Taille_pile].Effacer_curseur;
|
||||
|
||||
if (Blink) Effacer_curseur();
|
||||
|
||||
Operation[Operation_en_cours][Mouse_K][Operation_Taille_pile].Action();
|
||||
Operation[Operation_en_cours][Mouse_K_Unique][Operation_Taille_pile].Action();
|
||||
|
||||
if (Blink) Afficher_curseur();
|
||||
}
|
||||
@ -1868,10 +1867,7 @@ void Deplacer_fenetre(short Dx, short Dy)
|
||||
Ancien_X=Nouveau_X;
|
||||
Ancien_Y=Nouveau_Y;
|
||||
|
||||
while(!Get_input())
|
||||
{
|
||||
Wait_VBL();
|
||||
}
|
||||
while(!Get_input()) Wait_VBL();
|
||||
|
||||
Nouveau_X=Mouse_X-Dx;
|
||||
|
||||
|
||||
17
operatio.c
17
operatio.c
@ -2026,7 +2026,6 @@ void Spray_1_0(void)
|
||||
|
||||
Operation_PUSH(Pinceau_X);
|
||||
Operation_PUSH(Pinceau_Y);
|
||||
Operation_PUSH(A_GAUCHE);
|
||||
}
|
||||
|
||||
void Spray_2_0(void)
|
||||
@ -2046,22 +2045,19 @@ void Spray_2_0(void)
|
||||
|
||||
Operation_PUSH(Pinceau_X);
|
||||
Operation_PUSH(Pinceau_Y);
|
||||
Operation_PUSH(A_DROITE);
|
||||
}
|
||||
|
||||
void Spray_12_3(void)
|
||||
void Spray_12_2(void)
|
||||
//
|
||||
// Opération : OPERATION_SPRAY
|
||||
// Click Souris: 1 ou 2
|
||||
// Taille_Pile : 1
|
||||
// Taille_Pile : 2
|
||||
//
|
||||
// Souris effacée: Non
|
||||
//
|
||||
{
|
||||
short Bouton_clicke;
|
||||
short Ancien_X,Ancien_Y;
|
||||
|
||||
Operation_POP(&Bouton_clicke);
|
||||
Operation_POP(&Ancien_Y);
|
||||
Operation_POP(&Ancien_X);
|
||||
|
||||
@ -2075,24 +2071,23 @@ void Spray_12_3(void)
|
||||
if (SDL_GetTicks()>Spray_next_time)
|
||||
{
|
||||
Spray_next_time+=Spray_Delay*10;
|
||||
Aerographe(Bouton_clicke);
|
||||
Aerographe(Mouse_K_Unique);
|
||||
}
|
||||
|
||||
Operation_PUSH(Pinceau_X);
|
||||
Operation_PUSH(Pinceau_Y);
|
||||
Operation_PUSH(Bouton_clicke);
|
||||
}
|
||||
|
||||
void Spray_0_3(void)
|
||||
void Spray_0_2(void)
|
||||
//
|
||||
// Opération : OPERATION_SPRAY
|
||||
// Click Souris: 0
|
||||
// Taille_Pile : 3
|
||||
// Taille_Pile : 2
|
||||
//
|
||||
// Souris effacée: Non
|
||||
//
|
||||
{
|
||||
Operation_Taille_pile-=3;
|
||||
Operation_Taille_pile-=2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -139,8 +139,8 @@ void Courbe_3_points_12_11(void);
|
||||
|
||||
void Spray_1_0(void);
|
||||
void Spray_2_0(void);
|
||||
void Spray_12_3(void);
|
||||
void Spray_0_3(void);
|
||||
void Spray_12_2(void);
|
||||
void Spray_0_2(void);
|
||||
|
||||
//////////////////////////////////////////////////////////// OPERATION_*POLY*
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user