[AD] Two dumb little patches |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: alleg-developers@xxxxxxxxxx
- Subject: [AD] Two dumb little patches
- From: Chris <chris.kcat@xxxxxxxxxx>
- Date: Mon, 11 Apr 2005 15:27:02 -0700
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:x-accept-language:mime-version:to:subject:content-type; b=Zl8JGuu7lLNgDxAKQXV1XgE//fCZ5kDrhwczda3oirQrPnlBDskOMHQ6WCAsoEAtgPgdpBj8jM8jfk/mc/mBIAiVLZaL4uZgXTUAxaLpaCe2GzrLNi4GAEbJHUytZ/rKv1husRcCZKaQkA2hidlne/loyDBEJxA60JL8Jdpdpv4=
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 */