[AD] small demo patch

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


After trying the uthreads.c and color conversion stuff with the demo, I
had to change the KEY_SPACE assignement, since on my keyboard, space,
up, and left can't be pressed at the same time, but control, up and left
can.

And I replaced a busy loop I accidently spotted by rest(), since I hate
busy loops.

And I enabled page flipping for the X11 port (not sure why the change
enables it. This is something else which needs investigation :|). And
once enabled, page flpping shows the expal keyboard behavior. Oh well.
The X11 page flipping probably makes no sense anyway, but guess it
should be added to the TODO and investigated.

-- 
Elias Pschernig
Index: demo/demo.c
===================================================================
RCS file: /cvsroot/alleg/allegro/demo/demo.c,v
retrieving revision 1.23
diff -r1.23 demo.c
388c388,389
<       if ((key[KEY_SPACE]) || (joy[0].button[0].b) || (joy[0].button[1].b)) {
---
>       if ((key[KEY_SPACE] || key[KEY_LCONTROL] || key[KEY_RCONTROL]) ||
> 	 (joy[0].button[0].b) || (joy[0].button[1].b)) {
2166,2167d2166
<    c = retrace_count;
< 
2169,2171c2168
<       do {
<       } while (retrace_count-c < 120);
< 
---
>       rest (1000);
2186c2183
<    if (set_gfx_mode(c, w, h, 0, 0) != 0) {
---
>    if (set_gfx_mode(c, w, h, w, h * 2) != 0 && set_gfx_mode(c, w, h, 0, 0) != 0) {


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/