[Patch] Fixing Bug 118996 notify new stones in the iagno game.



I've done a patch to show a short animation when a new movement is
realized. I took the idea from the bug 118996. I created a new
animation so I needed also to change the theme picture, you can see it
here: http://img22.imageshack.us/img22/3435/classic.png

Maybe it's a little quick but if you want I can make the animation a
longer, but it will make the image bigger. If you like the animation I
can do the same for the other theme.

The code it's very simple I think. When a new movement is notified we
start the animation in its specific frame and when animation is over
the normal image is shown. Ok here is the diff:

Index: othello.c
===================================================================
--- othello.c   (revisión: 8974)
+++ othello.c   (copia de trabajo)
@@ -270,6 +270,10 @@

   pixmaps[x][y] = (gint8) me;
   gui_draw_pixmap (me, x, y);
+  if(me == WHITE_TURN)
+      pixmaps[x][y] = (gint8) 32 ;
+  else
+      pixmaps[x][y] = (gint8) 40 ;

   gui_status ();

Index: gnothello.c
===================================================================
--- gnothello.c (revisión: 8974)
+++ gnothello.c (copia de trabajo)
@@ -504,7 +504,7 @@
    if (pixmaps[i][j] > 0)
      gui_draw_pixmap (pixmaps[i][j], i, j);
    flipped_tiles = 1;
-      } else if (pixmaps[i][j] > board[i][j] && pixmaps[i][j] != 101) {
+      } else if (pixmaps[i][j] > board[i][j] && pixmaps[i][j] < 32) {
    if (animate == 0) {
      if (pixmaps[i][j] == WHITE_TURN)
        pixmaps[i][j] = board[i][j];
@@ -528,6 +528,37 @@
    if (pixmaps[i][j] < 32)
      gui_draw_pixmap (pixmaps[i][j], i, j);
    flipped_tiles = 1;
+      } else if (pixmaps[i][j]>=32 && pixmaps[i][j]<=39
+              && board[i][j]==WHITE_TURN) {
+          if(animate == 0)
+              pixmaps[i][j] = board[i][j];
+          else if (animate == 1)
+          {
+              pixmaps[i][j]+=2;
+          }
+          else if (animate == 2)
+          {
+              pixmaps[i][j]++;
+          }
+          if(pixmaps[i][j]>=40)
+              pixmaps[i][j]=board[i][j];
+
+          gui_draw_pixmap (pixmaps[i][j], i, j);
+          flipped_tiles=1;
+
+      } else if (pixmaps[i][j]>=40 && pixmaps[i][j]<=47
+              && board[i][j]==BLACK_TURN) {
+          if(animate == 0)
+              pixmaps[i][j] = board[i][j];
+          else if (animate == 1)
+                  pixmaps[i][j]+=2;
+          else if (animate == 2)
+                  pixmaps[i][j]++;
+
+          if(pixmaps[i][j]>=48)
+              pixmaps[i][j]=board[i][j];
+          gui_draw_pixmap (pixmaps[i][j], i, j);
+          flipped_tiles=1;
       }
     }


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