[AD] Adding ASSERTS to enforce sequential usage of (un)select_palette |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: Allegro developers mailing list <alleg-developers@xxxxxxxxxx>
- Subject: [AD] Adding ASSERTS to enforce sequential usage of (un)select_palette
- From: Grzegorz Adam Hankiewicz <gradha@xxxxxxxxxx>
- Date: Sat, 11 Dec 2004 23:24:58 +0000
Index: src/gfx.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/gfx.c,v
retrieving revision 1.20
diff -u -p -r1.20 gfx.c
--- src/gfx.c 11 Dec 2004 22:54:56 -0000 1.20
+++ src/gfx.c 11 Dec 2004 23:21:25 -0000
@@ -255,6 +255,7 @@ void select_palette(AL_CONST PALETTE p)
}
}
+ ASSERT(_got_prev_current_palette == FALSE);
_got_prev_current_palette = TRUE;
_current_palette_changed = 0xFFFFFFFF & ~(1<<(_color_depth-1));
@@ -277,6 +278,7 @@ void unselect_palette()
palette_color[c] = prev_palette_color[c];
}
+ ASSERT(_got_prev_current_palette == TRUE);
_got_prev_current_palette = FALSE;
_current_palette_changed = 0xFFFFFFFF & ~(1<<(_color_depth-1));