Critical fix for Airbrush, to prevent it from spiraling to death when airbrushing time-consuming brushes : Event queue would fill with 'tick' events, mouse button release wouldn't be caught, more airbrushing , more cpu cost, deadlock

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1569 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud 2010-08-11 00:23:56 +00:00
parent 25796b9188
commit cd39485232
2 changed files with 11 additions and 5 deletions

View File

@ -779,7 +779,7 @@ int Get_input(void)
break; break;
case SDL_USEREVENT: case SDL_USEREVENT:
user_feedback_required = 1; //user_feedback_required = 1;
break; break;
default: default:
//DEBUG("Unhandled SDL event number : ",event.type); //DEBUG("Unhandled SDL event number : ",event.type);

View File

@ -1908,10 +1908,13 @@ void Airbrush_1_0(void)
Backup(); Backup();
Shade_table=Shade_table_left; Shade_table=Shade_table_left;
Airbrush_next_time = SDL_GetTicks()+Airbrush_delay*10;
//Need_Timer_events=1; //Need_Timer_events=1;
//Activate_timer(10); //Activate_timer(10);
Airbrush(LEFT_SIDE); if (SDL_GetTicks()>Airbrush_next_time)
{
Airbrush(LEFT_SIDE);
Airbrush_next_time = SDL_GetTicks()+Airbrush_delay*10;
}
Operation_push(Paintbrush_X); Operation_push(Paintbrush_X);
Operation_push(Paintbrush_Y); Operation_push(Paintbrush_Y);
@ -1932,10 +1935,13 @@ void Airbrush_2_0(void)
Init_start_operation(); Init_start_operation();
Backup(); Backup();
Shade_table=Shade_table_right; Shade_table=Shade_table_right;
Airbrush_next_time = SDL_GetTicks()+Airbrush_delay*10;
//Need_Timer_events=1; //Need_Timer_events=1;
//Activate_timer(10); //Activate_timer(10);
Airbrush(RIGHT_SIDE); if (SDL_GetTicks()>Airbrush_next_time)
{
Airbrush(RIGHT_SIDE);
Airbrush_next_time = SDL_GetTicks()+Airbrush_delay*10;
}
Operation_push(Paintbrush_X); Operation_push(Paintbrush_X);
Operation_push(Paintbrush_Y); Operation_push(Paintbrush_Y);