char global_x_marking ;
char global_y_marking ;


/* Version ou on limite le nombre de truc empiles pour eviter de */
/* peter la pile. De plus, ce schema de recursion est exactement */
/* borne par la taille de la piece. A priori je pense que c'est  */
/* ce qu'on peut faire de mieux.                                 */
/* si la pile pete toujours, la seule solution restante est de   */
/* faire une version iterative avec une pile geree explicitement */
/* une pile de taille 4 doit suffir avec un peu de hack...       */
void mark_bits ()
{
  /* Marquer la case */
  SET_MARKED (bits[global_x_marking][global_y_marking]) ;
  /* Il faudra verifier a la fin que la surface */
  /* reellement marquee est superieure a 1      */
  marked_surface++ ;
  /* Maintenant, on regarde si chacun des voisins est de la couleur */
  /* choisie pour l'effacement, s'il n'est pas deja marque comme a  */
  /* effacer, et si il se trouve bien dans la surface de jeu. Si    */
  /* c'est le cas, alors on recurse un coup.                        */

  global_x_marking-- ;
  if ((global_x_marking >= 0) &&
      (GET_COLOR (bits[global_x_marking][global_y_marking])==current_color) &&
      (!IS_MARKED (bits[global_x_marking][global_y_marking])))
    mark_bits () ;

  global_x_marking += 2 ;
  if ((global_x_marking < BITS_WIDTH) &&
      (GET_COLOR (bits[global_x_marking][global_y_marking])==current_color) &&
      (!IS_MARKED (bits[global_x_marking][global_y_marking])))
    mark_bits () ;
  global_x_marking-- ;

  global_y_marking-- ;
  if ((global_y_marking >= 0) &&
      (GET_COLOR (bits[global_x_marking][global_y_marking])==current_color) &&
      (!IS_MARKED (bits[global_x_marking][global_y_marking])))
    mark_bits () ;
  global_y_marking += 2 ;

  if ((global_y_marking < BITS_HEIGHT) &&
      (GET_COLOR (bits[global_x_marking][global_y_marking])==current_color) &&
      (!IS_MARKED (bits[global_x_marking][global_y_marking])))
    mark_bits () ;
  global_y_marking-- ;
}
