summaryrefslogtreecommitdiffstats
path: root/libdimension
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-11-07 17:39:23 -0500
committerTavian Barnes <tavianator@gmail.com>2010-11-07 17:39:23 -0500
commit4ddd6b7f2ec82155b7535062b4af67618ce70e30 (patch)
treed5a552473831b3b92030d0e33a1bafe7169737b8 /libdimension
parentd3250a168254ebc6aa0087dfcfee5d7dfead9703 (diff)
downloaddimension-4ddd6b7f2ec82155b7535062b4af67618ce70e30.tar.xz
Support checkered pigments in dimension.
Diffstat (limited to 'libdimension')
-rw-r--r--libdimension/dimension/array.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/libdimension/dimension/array.h b/libdimension/dimension/array.h
index b718021..fa48ac0 100644
--- a/libdimension/dimension/array.h
+++ b/libdimension/dimension/array.h
@@ -170,10 +170,16 @@ dmnsn_array_remove(dmnsn_array *array, size_t i)
dmnsn_array_resize(array, size - 1);
}
-/* Macro to shorten array iteration */
+/* Macros to shorten array iteration */
+
#define DMNSN_ARRAY_FOREACH(type, i, array) \
for (type i = dmnsn_array_first(array); \
i - (type)dmnsn_array_first(array) < dmnsn_array_size(array); \
++i)
+#define DMNSN_ARRAY_FOREACH_REVERSE(type, i, array) \
+ for (type i = dmnsn_array_last(array); \
+ (type)dmnsn_array_last(array) - i < dmnsn_array_size(array); \
+ --i)
+
#endif /* DIMENSION_ARRAY_H */