* Use SDL_WaitEvent instead of SDL_PollEvent.

* To avoid the program getting 'locked' when there is no user input (sliders, colorspray), we use a timer that queues events to make grafX2 act (and refresh the screen)

TODO :
 * To reduce cpu usage when idle even more, start the timer only when it's needed (colorspray is drawing, or a scrollbar is scrolling)
 * For now everyone uses the same timer, so the same delay. This means there is no fast-scroll and slow-scroll for sliders. Starting the timer with a different speed in each case would solve that
 * The event handling for sliders will currently react to any mouse event. Thismeans the slider will move faster if you slightly move the mouse while keeping in the button. Not what wewant, so weshoud all a timer_expired global and the slider should wait for that (and reset it when acknowledged).

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1556 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Adrien Destugues
2010-08-06 15:40:01 +00:00
parent bce1c9d7ee
commit 5ee0b4943f
5 changed files with 37 additions and 20 deletions

View File

@@ -42,7 +42,6 @@ void Palette_256_to_64(T_Palette palette);
void Palette_64_to_256(T_Palette palette);
void Clear_current_image(byte color);
void Clear_current_image_with_stencil(byte color, byte * stencil);
void Slider_timer(byte speed);
dword Round_div(dword numerator,dword divisor);
word Count_used_colors(dword * usage);
word Count_used_colors_area(dword* usage, word start_x, word start_y, word width, word height);