Re: [AD] TODO List for Allegro

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


> This email may be a duplicate. Just in case the first one wasn't sent.
> A dxwindow patch (solution 2), completely using accelerator tables:

I've commited the attached patch, which is identical except for some 
formatting.

Evert
Index: dxwindow.c
===================================================================
RCS file: /cvsroot/alleg/allegro/tests/win/dxwindow.c,v
retrieving revision 1.2
diff -u -r1.2 dxwindow.c
--- dxwindow.c	5 Oct 2002 06:40:18 -0000	1.2
+++ dxwindow.c	27 Jul 2004 08:14:43 -0000
@@ -278,6 +278,10 @@
                PostMessage(hwnd, WM_CLOSE, 0, 0);
                break;
 
+            case CMD_SET_BOOST:
+               boost();
+               break;
+                
             case CMD_SET_SPEED_UP:
                timer_speed -= TIMER_STEP;
                if (timer_speed < TIMER_SPEED_MIN)
@@ -384,7 +388,6 @@
       return 0;
 
    install_timer();
-   install_keyboard();
    install_sound(DIGI_AUTODETECT, MIDI_NONE, NULL);
 
    /* install the DirectX windowed driver */
@@ -434,12 +437,6 @@
    /* main loop */
    while (TRUE) {
 
-      /* process the keys */
-      while (keypressed()) {
-         if ((readkey() >> 8) == KEY_B)
-            boost();
-      }
-
       /* animate the screen */
       clear(video_page[next_page]);
       if (!running)
Index: dxwindow.rc
===================================================================
RCS file: /cvsroot/alleg/allegro/tests/win/dxwindow.rc,v
retrieving revision 1.1
diff -u -r1.1 dxwindow.rc
--- dxwindow.rc	16 Sep 2002 16:17:30 -0000	1.1
+++ dxwindow.rc	27 Jul 2004 08:14:43 -0000
@@ -7,6 +7,8 @@
 BEGIN
    VK_F1, CMD_FILE_RUN, VIRTKEY
    VK_F2, CMD_FILE_STOP, VIRTKEY
+   "B", CMD_SET_BOOST, VIRTKEY
+   "s", CMD_SET_BOOST, VIRTKEY
    VK_ADD, CMD_SET_SPEED_UP, CONTROL, VIRTKEY
    VK_SUBTRACT, CMD_SET_SPEED_DOWN, CONTROL, VIRTKEY
 END
@@ -23,6 +25,7 @@
 
    POPUP "&Settings"
    BEGIN
+      MENUITEM "Boost\tB", CMD_SET_BOOST
       MENUITEM "Speed up\tCtrl +", CMD_SET_SPEED_UP
       MENUITEM "Speed down\tCtrl -", CMD_SET_SPEED_DOWN
       MENUITEM "Default Speed", CMD_SET_SPEED_DEFAULT
Index: dxwindow.rh
===================================================================
RCS file: /cvsroot/alleg/allegro/tests/win/dxwindow.rh,v
retrieving revision 1.1
diff -u -r1.1 dxwindow.rh
--- dxwindow.rh	16 Sep 2002 16:17:30 -0000	1.1
+++ dxwindow.rh	27 Jul 2004 08:14:43 -0000
@@ -4,6 +4,7 @@
 #define CMD_FILE_STOP           101
 #define CMD_FILE_EXIT           102
 #define CMD_SET_SPEED_UP        103
-#define CMD_SET_SPEED_DOWN      104
-#define CMD_SET_SPEED_DEFAULT   105
-#define CMD_HELP_ABOUT          106
+#define CMD_SET_BOOST           104
+#define CMD_SET_SPEED_DOWN      105
+#define CMD_SET_SPEED_DEFAULT   106
+#define CMD_HELP_ABOUT          107


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