~ubuntu-branches/ubuntu/intrepid/gnome-games/intrepid

« back to all changes in this revision

Viewing changes to gnotravex/gnotravex.c

  • Committer: Package Import Robot
  • Author(s): Didier Roche
  • Date: 2008-10-21 00:30:34 UTC
  • mfrom: (1.1.58)
  • Revision ID: package-import@ubuntu.com-20081021003034-cb0iknvzten935zn
Tags: 1:2.24.1-0ubuntu1
* New upstream release (LP: #286667)
  - General:
    - Fix up compatiblity with Gtk/Glib 2.14
    - Reclassify Gnibbles as Arcade game not logic game
    - Read saved window configuration from correct GConf group (affects
      gnometris, gnibbles, gnobots)
  - Aisleriot:
    - Remove vestigal flowRoot elements from solitaire svg icons. They
      caused a black box when rendering.
    - Don't crash when the session manager terminates aisleriot
  - GLChess:
    - Fix crash in error handler when GGZ connection closed
    - Fix crash in empty scene when no AI engines available
    - Fix crash when have OpenGL libraries but cannot get valid display
    - Implement GGZ config parser instead of using Python config parser
      which does not handle '%' characters as GGZ does
    - Ignore GGZ server remove player/table for unknown players/tables
    - Handle exceptions loading OpenGL textures
    - Reset pause menu when starting new game
    - Only allow one new/load game dialog to be visible at once
    - Fix incorrect function call for single buffered 3D display
    - Handle fork() errors in AI processes
    - Fixes to compile in Solaris
    - Print failure to start message to stdout if cannot import GTK+
    - Handle invalid response from glRenderMode(GL_RENDER) and print
      debugging information
    - More logging messages about selection rendering bugs
    - After looking at failure case in PyOpenGL code we don't need to change
      render modes after failed to change to GL_SELECT
    - Fix potential bugs found by PyChecker
    - Fix crash when validly claiming a draw
    - Don't display failed to claim draw dialog when successfully claimed
      draw
  - GTali:
    - Undoing 5 of a kind reduces the score by 50 as there might be multiple
      scores (LP: #238978)
  - Sudoku:
    - Add not overwrite time and also remember to actually save the time in
      the file (LP: #279616)
    - Correct typo in error message that led to an exception
  - Gnotravex:
    - Stop paused tiles becoming visible after changing colour settings
  - Blackjack:
    - Fix compiler warnings

Show diffs side-by-side

added added

removed removed

Lines of Context:
226
226
void gui_draw_tile (GdkPixmap * target, GtkStateType state, gint xadd,
227
227
                    gint yadd, gint north, gint south, gint east, gint west, gboolean prelight);
228
228
void gui_draw_pixmap (GdkPixmap *, gint, gint, gboolean);
229
 
void gui_draw_pause (void);
230
229
 
231
230
void get_pixeltilexy (gint, gint, gint *, gint *);
232
231
void get_tilexy (gint, gint, gint *, gint *);
951
950
    get_tilexy (event->x, event->y, &x, &y);
952
951
    if ((x != oldx) || (y != oldy)) {
953
952
      if ((oldx != -1) && (tiles[oldy][oldx].status == USED)) {
954
 
         gui_draw_pixmap (buffer, oldx, oldy, FALSE);
 
953
        gui_draw_pixmap (buffer, oldx, oldy, FALSE);
955
954
      }
956
955
      if ((x != -1) && (tiles[y][x].status == USED)) {
957
 
        gui_draw_pixmap (buffer, x, y, TRUE);
 
956
        gui_draw_pixmap (buffer, x, y, TRUE);
958
957
      }
959
958
      oldx = x;
960
959
      oldy = y;
987
986
  if (prelight)
988
987
    state = GTK_STATE_PRELIGHT;
989
988
 
990
 
  if (which == USED)
991
 
    gui_draw_tile (target, state, xadd, yadd, tiles[y][x].n, tiles[y][x].s,
992
 
                   tiles[y][x].e, tiles[y][x].w, state);
 
989
  if (which == USED) {
 
990
    if (game_state == paused)
 
991
      gui_draw_tile (buffer, GTK_STATE_NORMAL, xadd, yadd, 0, 0, 0, 0, FALSE);    
 
992
    else
 
993
      gui_draw_tile (target, state, xadd, yadd, tiles[y][x].n, tiles[y][x].s,
 
994
                     tiles[y][x].e, tiles[y][x].w, state);
 
995
  }
993
996
  else
994
997
    gui_draw_socket (target, state, xadd, yadd);
995
998
 
1324
1327
  update_tile_size (event->width, event->height);
1325
1328
  make_buffer (widget);
1326
1329
  redraw_all ();
1327
 
  if (game_state == paused)
1328
 
    gui_draw_pause ();
1329
1330
  gtk_widget_thaw_child_notify (widget);
1330
1331
 
1331
1332
  return FALSE;
1349
1350
  for (y = 0; y < size; y++)
1350
1351
    for (x = 0; x < size * 2; x++)
1351
1352
      gui_draw_pixmap (buffer, x, y, FALSE);
1352
 
   
 
1353
 
1353
1354
  gui_draw_arrow(buffer);
1354
1355
 
1355
1356
  gdk_window_end_paint (space->window);
1499
1500
  if (game_state != paused) {
1500
1501
    game_state = paused;
1501
1502
    message (_("Game paused"));
1502
 
    gui_draw_pause ();
 
1503
    redraw_all ();
1503
1504
    update_move_menu_sensitivity ();
1504
1505
    gtk_action_set_sensitive (hint_action, FALSE);
1505
1506
    gtk_action_set_sensitive (solve_action, FALSE);
1535
1536
}
1536
1537
 
1537
1538
void
1538
 
gui_draw_pause (void)
1539
 
{
1540
 
  guint x, y, xadd, yadd, which;
1541
 
  GdkRegion *region;
1542
 
 
1543
 
  if (!space->window)
1544
 
    return;
1545
 
 
1546
 
  region = gdk_drawable_get_clip_region (GDK_DRAWABLE (space->window));
1547
 
  gdk_window_begin_paint_region (space->window, region);
1548
 
  gdk_draw_rectangle (space->window, bg_gc, TRUE, 0, 0, -1, -1);
1549
 
 
1550
 
  for (y = 0; y < size; y++) {
1551
 
    for (x = 0; x < size * 2; x++) {
1552
 
      which = tiles[y][x].status;
1553
 
 
1554
 
      xadd = x * tile_size + xborder + (x >= size) * gap;
1555
 
      yadd = y * tile_size + yborder;
1556
 
 
1557
 
      if (which == USED)
1558
 
        gui_draw_tile (buffer, GTK_STATE_NORMAL, xadd, yadd, 0, 0, 0, 0, 
1559
 
                       FALSE);
1560
 
      else
1561
 
        gui_draw_socket (buffer, GTK_STATE_NORMAL, xadd, yadd);
1562
 
 
1563
 
      gtk_widget_queue_draw_area (space, xadd, yadd, tile_size, tile_size);
1564
 
    }
1565
 
  }
1566
 
 
1567
 
  gdk_window_end_paint (space->window);
1568
 
  gdk_region_destroy (region);
1569
 
}
1570
 
 
1571
 
void
1572
1539
timer_start (void)
1573
1540
{
1574
1541
  games_clock_stop (GAMES_CLOCK (timer));
1644
1611
new_game (){
1645
1612
  gchar *str;
1646
1613
 
 
1614
  /* Reset pause menu */
 
1615
  gtk_action_set_visible(pause_action, TRUE);
 
1616
  gtk_action_set_sensitive(pause_action, TRUE);
 
1617
  gtk_action_set_visible(resume_action, FALSE);
 
1618
  gtk_action_set_sensitive(resume_action, FALSE);
 
1619
    
 
1620
  game_state = playing;
 
1621
 
1647
1622
  new_board (size);
1648
1623
  gtk_widget_freeze_child_notify (space);
1649
1624
  make_buffer (space);
1650
1625
  redraw_all ();
1651
1626
  gtk_widget_thaw_child_notify (space);
1652
 
  game_state = playing;
1653
1627
  timer_start ();
1654
1628
  set_game_menu_items_sensitive (TRUE);
1655
1629
  update_move_menu_sensitivity ();