gnome-games r8003 - branches/gnome-2-24/gnotravex



Author: rancell
Date: Mon Oct 13 06:56:17 2008
New Revision: 8003
URL: http://svn.gnome.org/viewvc/gnome-games?rev=8003&view=rev

Log:
Stop paused tiles becoming visible after changing colour settings (Bug #550023)

Modified:
   branches/gnome-2-24/gnotravex/gnotravex.c

Modified: branches/gnome-2-24/gnotravex/gnotravex.c
==============================================================================
--- branches/gnome-2-24/gnotravex/gnotravex.c	(original)
+++ branches/gnome-2-24/gnotravex/gnotravex.c	Mon Oct 13 06:56:17 2008
@@ -226,7 +226,6 @@
 void gui_draw_tile (GdkPixmap * target, GtkStateType state, gint xadd,
 		    gint yadd, gint north, gint south, gint east, gint west, gboolean prelight);
 void gui_draw_pixmap (GdkPixmap *, gint, gint, gboolean);
-void gui_draw_pause (void);
 
 void get_pixeltilexy (gint, gint, gint *, gint *);
 void get_tilexy (gint, gint, gint *, gint *);
@@ -951,10 +950,10 @@
     get_tilexy (event->x, event->y, &x, &y);
     if ((x != oldx) || (y != oldy)) {
       if ((oldx != -1) && (tiles[oldy][oldx].status == USED)) {
-	 gui_draw_pixmap (buffer, oldx, oldy, FALSE);
+        gui_draw_pixmap (buffer, oldx, oldy, FALSE);
       }
       if ((x != -1) && (tiles[y][x].status == USED)) {
-	gui_draw_pixmap (buffer, x, y, TRUE);
+        gui_draw_pixmap (buffer, x, y, TRUE);
       }
       oldx = x;
       oldy = y;
@@ -987,9 +986,13 @@
   if (prelight)
     state = GTK_STATE_PRELIGHT;
 
-  if (which == USED)
-    gui_draw_tile (target, state, xadd, yadd, tiles[y][x].n, tiles[y][x].s,
-		   tiles[y][x].e, tiles[y][x].w, state);
+  if (which == USED) {
+    if (game_state == paused)
+      gui_draw_tile (buffer, GTK_STATE_NORMAL, xadd, yadd, 0, 0, 0, 0, FALSE);    
+    else
+      gui_draw_tile (target, state, xadd, yadd, tiles[y][x].n, tiles[y][x].s,
+                     tiles[y][x].e, tiles[y][x].w, state);
+  }
   else
     gui_draw_socket (target, state, xadd, yadd);
 
@@ -1324,8 +1327,6 @@
   update_tile_size (event->width, event->height);
   make_buffer (widget);
   redraw_all ();
-  if (game_state == paused)
-    gui_draw_pause ();
   gtk_widget_thaw_child_notify (widget);
 
   return FALSE;
@@ -1349,7 +1350,7 @@
   for (y = 0; y < size; y++)
     for (x = 0; x < size * 2; x++)
       gui_draw_pixmap (buffer, x, y, FALSE);
-   
+
   gui_draw_arrow(buffer);
 
   gdk_window_end_paint (space->window);
@@ -1499,7 +1500,7 @@
   if (game_state != paused) {
     game_state = paused;
     message (_("Game paused"));
-    gui_draw_pause ();
+    redraw_all ();
     update_move_menu_sensitivity ();
     gtk_action_set_sensitive (hint_action, FALSE);
     gtk_action_set_sensitive (solve_action, FALSE);
@@ -1535,40 +1536,6 @@
 }
 
 void
-gui_draw_pause (void)
-{
-  guint x, y, xadd, yadd, which;
-  GdkRegion *region;
-
-  if (!space->window)
-    return;
-
-  region = gdk_drawable_get_clip_region (GDK_DRAWABLE (space->window));
-  gdk_window_begin_paint_region (space->window, region);
-  gdk_draw_rectangle (space->window, bg_gc, TRUE, 0, 0, -1, -1);
-
-  for (y = 0; y < size; y++) {
-    for (x = 0; x < size * 2; x++) {
-      which = tiles[y][x].status;
-
-      xadd = x * tile_size + xborder + (x >= size) * gap;
-      yadd = y * tile_size + yborder;
-
-      if (which == USED)
-	gui_draw_tile (buffer, GTK_STATE_NORMAL, xadd, yadd, 0, 0, 0, 0, 
-		       FALSE);
-      else
-	gui_draw_socket (buffer, GTK_STATE_NORMAL, xadd, yadd);
-
-      gtk_widget_queue_draw_area (space, xadd, yadd, tile_size, tile_size);
-    }
-  }
-
-  gdk_window_end_paint (space->window);
-  gdk_region_destroy (region);
-}
-
-void
 timer_start (void)
 {
   games_clock_stop (GAMES_CLOCK (timer));
@@ -1649,13 +1616,14 @@
   gtk_action_set_sensitive(pause_action, TRUE);
   gtk_action_set_visible(resume_action, FALSE);
   gtk_action_set_sensitive(resume_action, FALSE);
+    
+  game_state = playing;
 
   new_board (size);
   gtk_widget_freeze_child_notify (space);
   make_buffer (space);
   redraw_all ();
   gtk_widget_thaw_child_notify (space);
-  game_state = playing;
   timer_start ();
   set_game_menu_items_sensitive (TRUE);
   update_move_menu_sensitivity ();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]