[Commit] grrobot/src grr_board_view.c,1.9,1.10 grr_board_view.h,1.6,1.7 grrobot.c,1.10,1.11

Carl Worth commit at keithp.com
Thu Jun 26 21:13:18 PDT 2003


Committed by: cworth

Update of /local/src/CVS/grrobot/src
In directory home.keithp.com:/tmp/cvs-serv17880/src

Modified Files:
	grr_board_view.c grr_board_view.h grrobot.c 
Log Message:
Resized the  graphics slightly. The walls are thinner, the padding is smaller, and
the targets and robots are a bit larger. Also, added black trim around all solid-color targets.
Removed "manual" drawing of grid, incorporating it into cell.svg instead.

Better message when the server goes away.

Index: grr_board_view.c
===================================================================
RCS file: /local/src/CVS/grrobot/src/grr_board_view.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- grr_board_view.c	26 Jun 2003 01:19:40 -0000	1.9
+++ grr_board_view.c	27 Jun 2003 03:13:15 -0000	1.10
@@ -305,8 +305,8 @@
     grr_board_view_draw_walls (view, xrs, RR_CELL_GET_WALLS (cell));
     XrRestore (xrs);
 
-    xpad = width / 5;
-    ypad = width / 5;
+    xpad = width / 10;
+    ypad = width / 10;
 
     XrSave (xrs);
     XrTranslate (xrs, xpad, ypad);
@@ -328,9 +328,9 @@
 	XrScale (xrs,
 		 width / GRR_SVG_ASSUMED_WIDTH,
 		 height / GRR_SVG_ASSUMED_HEIGHT);
-	XrRectangle (xrs, 0, 0,
-		     GRR_SVG_ASSUMED_WIDTH,
-		     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);
@@ -456,23 +456,6 @@
 	    XrRestore (xrs);
 	}
     }
-
-    /* Draw grid. */
-    XrSave (xrs);
-    {
-	XrSetRGBColor (xrs, .75, .75, 1);
-	XrSetLineWidth (xrs, 1);
-	for (j=0; j < view->board_height; j++) {
-	    XrMoveTo (xrs, 0, j * view->cell_height + 0.5);
-	    XrRelLineTo (xrs, view->board_width * view->cell_width, 0);
-	}
-	for (i=0; i < view->board_width; i++) {
-	    XrMoveTo (xrs, i * view->cell_width + 0.5, 0);
-	    XrRelLineTo (xrs, 0, view->board_height * view->cell_height);
-	}
-	XrStroke (xrs);
-    }
-    XrRestore (xrs);
 
     /* Draw goal target in center of board */
     XrSave (xrs);

Index: grr_board_view.h
===================================================================
RCS file: /local/src/CVS/grrobot/src/grr_board_view.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- grr_board_view.h	25 Jun 2003 10:52:59 -0000	1.6
+++ grr_board_view.h	27 Jun 2003 03:13:15 -0000	1.7
@@ -70,6 +70,7 @@
 
     grr_icon_t *cell_icon;
     grr_icon_t *wall_icon;
+
     grr_icon_t *robot_icon[RR_NUM_ROBOTS];
     grr_icon_t *target_icon[RR_NUM_TARGETS];
 };

Index: grrobot.c
===================================================================
RCS file: /local/src/CVS/grrobot/src/grrobot.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- grrobot.c	26 Jun 2003 11:17:33 -0000	1.10
+++ grrobot.c	27 Jun 2003 03:13:15 -0000	1.11
@@ -188,9 +188,12 @@
     while (rr_client_notice_pending (game->client)) {
 	status = rr_client_next_notice (game->client, &notice);
 	if (status) {
-	    fprintf (stderr, "Error during rr_client_next_notice: %s\n",
-		     rr_status_str (status));
-	    exit (1);
+	    if (status == RR_STATUS_EOF)
+		fprintf (stderr, "The server has disconnected, exiting.\n");
+	    else
+		fprintf (stderr, "Error during rr_client_next_notice: %s\n",
+			 rr_status_str (status));
+	    gtk_exit (1);
 	}
 	if (!notice) {
 	    fprintf (stderr, "Missing notice\n");




More information about the Commit mailing list