[Commit] grrobot/src Makefile.am, 1.4, 1.5 grr_board_view.c, 1.12, 1.13 grr_board_view.h, 1.9, 1.10 grr_icon.c, 1.3, 1.4 grrobot.c, 1.15, 1.16

Carl Worth commit at keithp.com
Sat Jul 26 02:37:14 PDT 2003


Committed by: cworth

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

Modified Files:
	Makefile.am grr_board_view.c grr_board_view.h grr_icon.c 
	grrobot.c 
Log Message:
Alternate two different background images. New planets for all squares.

Index: Makefile.am
===================================================================
RCS file: /local/src/CVS/grrobot/src/Makefile.am,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- Makefile.am	25 Jun 2003 10:52:59 -0000	1.4
+++ Makefile.am	26 Jul 2003 08:37:11 -0000	1.5
@@ -1,4 +1,4 @@
-SUBDIRS = . svg
+SUBDIRS = svg .
 
 bin_PROGRAMS = grrobot
 

Index: grr_board_view.c
===================================================================
RCS file: /local/src/CVS/grrobot/src/grr_board_view.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- grr_board_view.c	23 Jul 2003 21:34:34 -0000	1.12
+++ grr_board_view.c	26 Jul 2003 08:37:12 -0000	1.13
@@ -135,7 +135,8 @@
     view->cell_width = 0;
     view->cell_height = 0;
 
-    view->cell_icon = grr_icon_create ("cell");
+    view->cell1_icon = grr_icon_create ("cell1");
+    view->cell2_icon = grr_icon_create ("cell2");
     view->wall_icon = grr_icon_create ("wall");
 
     for (i=0; i < RR_NUM_ROBOTS; i++) {
@@ -376,7 +377,9 @@
 		 view->cell_width / GRR_SVG_ASSUMED_WIDTH,
 		 view->cell_height / GRR_SVG_ASSUMED_HEIGHT);
 
-	grr_icon_predraw (view->cell_icon, xrs,
+	grr_icon_predraw (view->cell1_icon, xrs,
+			  view->cell_width, view->cell_height);
+	grr_icon_predraw (view->cell2_icon, xrs,
 			  view->cell_width, view->cell_height);
 
 	grr_icon_predraw (view->wall_icon, xrs,
@@ -440,7 +443,10 @@
 	    cairo_save (xrs);
 	    cairo_translate (xrs, i * view->cell_width, j * view->cell_height);
 
-	    grr_icon_draw_predrawn (view->cell_icon, xrs);
+	    if ((i+j) % 2 == 0)
+		grr_icon_draw_predrawn (view->cell1_icon, xrs);
+	    else
+		grr_icon_draw_predrawn (view->cell2_icon, xrs);
 
 	    if (target) {
 		if (target && target != goal_target) {
@@ -470,6 +476,9 @@
 	cairo_scale (xrs,
 		     2 * view->cell_width / GRR_SVG_ASSUMED_WIDTH,
 		     2 * view->cell_height / GRR_SVG_ASSUMED_HEIGHT);
+	cairo_rectangle (xrs, 0, 0, GRR_SVG_ASSUMED_WIDTH, GRR_SVG_ASSUMED_HEIGHT);
+	cairo_set_rgb_color (xrs, 1, 1, 1);
+	cairo_fill (xrs);
 	grr_icon_draw (view->target_icon[rr_target_idx (goal_target)], xrs);
 	cairo_restore (xrs);
     }

Index: grr_board_view.h
===================================================================
RCS file: /local/src/CVS/grrobot/src/grr_board_view.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- grr_board_view.h	23 Jul 2003 21:34:34 -0000	1.9
+++ grr_board_view.h	26 Jul 2003 08:37:12 -0000	1.10
@@ -70,7 +70,8 @@
     /* ID of update timer, or 0 if none */
     guint32 timer;
 
-    grr_icon_t *cell_icon;
+    grr_icon_t *cell1_icon;
+    grr_icon_t *cell2_icon;
     grr_icon_t *wall_icon;
 
     grr_icon_t *robot_icon[RR_NUM_ROBOTS];

Index: grr_icon.c
===================================================================
RCS file: /local/src/CVS/grrobot/src/grr_icon.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- grr_icon.c	23 Jul 2003 21:34:34 -0000	1.3
+++ grr_icon.c	26 Jul 2003 08:37:12 -0000	1.4
@@ -91,8 +91,10 @@
     { RR_WALL_ABOVE, "wall",
       GRR_ICON_SVG_WALL, sizeof (GRR_ICON_SVG_WALL) },
 
-    { RR_WALL_NONE, "cell",
-      GRR_ICON_SVG_CELL, sizeof (GRR_ICON_SVG_CELL) }
+    { 0, "cell1",
+      GRR_ICON_SVG_CELL1, sizeof (GRR_ICON_SVG_CELL1) },
+    { 0, "cell2",
+      GRR_ICON_SVG_CELL2, sizeof (GRR_ICON_SVG_CELL2) }
 };
 #define NUM_BUILTINS (sizeof (builtins) / sizeof (builtins[0]))
 

Index: grrobot.c
===================================================================
RCS file: /local/src/CVS/grrobot/src/grrobot.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- grrobot.c	23 Jul 2003 21:34:34 -0000	1.15
+++ grrobot.c	26 Jul 2003 08:37:12 -0000	1.16
@@ -235,7 +235,7 @@
 	    fprintf (stderr, "Missing notice\n");
 	    continue;
 	}
-
+ 
 	switch (notice->type) {
 	case RR_NOTICE_USER:
 	    grr_game_printf (game,




More information about the Commit mailing list