+ /*
+ * Draw rectangle
+ * NOTE: Code paths are duplicated for efficiency
+ */
+ if (color) /* fill */
+ {
+ for (x = x1; x < x2; x++)
+ for (y = y1; y < y2; y++)
+ BM_PLOT(bm, x, y);
+ }
+ else /* clear */
+ {
+ for (x = x1; x < x2; x++)
+ for (y = y1; y < y2; y++)
+ BM_CLEAR(bm, x, y);
+ }
+}
+
+
+/*!
+ * Draw a filled rectangle.
+ *
+ * \note The bottom-right border of the rectangle is not drawn.
+ *
+ * \note This function does \b not update the current pen position
+ */
+void gfx_RectFill(Bitmap *bm, coord_t x1, coord_t y1, coord_t x2, coord_t y2)
+{
+ gfx_RectFillC(bm, x1, y1, x2, y2, 0xFF);
+}
+
+
+/*!
+ * Clear a rectangular area.
+ *
+ * \note The bottom-right border of the rectangle is not drawn.
+ *
+ * \note This function does \b not update the current pen position
+ */
+void gfx_RectClear(Bitmap *bm, coord_t x1, coord_t y1, coord_t x2, coord_t y2)
+{
+ gfx_RectFillC(bm, x1, y1, x2, y2, 0x00);