[AD] Two dumb little patches

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


I made a couple little patches. The first one defines a DIALOG_END macro that users can put at the end of DIALOG structs, without worrying about warnings with -W or having to type NULL and 0 a bunch of times. Used like this:

DIALOG dialog[] = {
   { d_clear_proc, ... },
   { d_text_proc, ... },
   { DIALOG_END }
};

The second makes code shutting down graphics look cleaner. Used like this:

set_gfx_mode(GFX_NONE);
Index: include/allegro/gui.h
===================================================================
RCS file: /cvsroot/alleg/allegro/include/allegro/gui.h,v
retrieving revision 1.15
diff -u -r1.15 gui.h
--- include/allegro/gui.h	30 Dec 2004 09:27:46 -0000	1.15
+++ include/allegro/gui.h	11 Apr 2005 22:18:26 -0000
@@ -95,6 +95,10 @@
 } MENU_PLAYER;
 
 
+/* empty dialog definition */
+#define DIALOG_END      NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL
+
+
 /* bits for the flags field */
 #define D_EXIT          1        /* object makes the dialog exit */
 #define D_SELECTED      2        /* object is selected */
Index: include/allegro/gfx.h
===================================================================
RCS file: /cvsroot/alleg/allegro/include/allegro/gfx.h,v
retrieving revision 1.16
diff -u -r1.16 gfx.h
--- include/allegro/gfx.h	7 Mar 2005 22:55:22 -0000	1.16
+++ include/allegro/gfx.h	11 Apr 2005 22:21:14 -0000
@@ -36,6 +36,7 @@
 #define GFX_AUTODETECT_FULLSCREEN      1
 #define GFX_AUTODETECT_WINDOWED        2
 #define GFX_SAFE                       AL_ID('S','A','F','E')
+#define GFX_NONE                       GFX_TEXT, 0, 0, 0, 0
 
 
 /* Blender mode defines, for the gfx_driver->set_blender_mode() function */


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