- XrRestore (xrs);
- }
-}
-
-static void
-grr_board_view_draw_cell (grr_board_view_t *view,
- XrState *xrs,
- rr_cell_t cell,
- rr_target_t goal,
- int width,
- int height)
-{
- int xpad, ypad;
- rr_robot_t robot;
- rr_target_t target;
-
- XrSave (xrs);
- XrScale (xrs,
- width / GRR_SVG_ASSUMED_WIDTH,
- height / GRR_SVG_ASSUMED_HEIGHT);
- grr_icon_draw (view->cell_icon, xrs);
- grr_board_view_draw_walls (view, xrs, RR_CELL_GET_WALLS (cell));
- XrRestore (xrs);
-
- xpad = width / 10;
- ypad = width / 10;
-
- XrSave (xrs);
- XrTranslate (xrs, xpad, ypad);
- XrScale (xrs,
- (width - 2*xpad) / GRR_SVG_ASSUMED_WIDTH,
- (height - 2*ypad) / GRR_SVG_ASSUMED_HEIGHT);
-
- target = RR_CELL_GET_TARGET (cell);
- if (target)
- grr_icon_draw (view->target_icon[rr_target_idx (target)], xrs);
-
- XrRestore (xrs);
-
- /* XXX: This is a kludge, (it obscures the cell background in
- addition to the target). The real way to do this is to draw the
- target itself with less opacity. */
- if (target && target != goal) {
- XrSave (xrs);
- XrScale (xrs,
- width / GRR_SVG_ASSUMED_WIDTH,
- height / GRR_SVG_ASSUMED_HEIGHT);
- XrRectangle (xrs, 1, 1,
- GRR_SVG_ASSUMED_WIDTH - 1,
- GRR_SVG_ASSUMED_HEIGHT - 1);
- XrSetRGBColor (xrs, 1, 1, 1);
- XrSetAlpha (xrs, 0.75);
- XrFill (xrs);
- XrRestore (xrs);