Exemplo n.º 1
0
void
mr_view_page_trans (enum dir d)
{
  int x, y;

  mr.select_cycles = SELECT_CYCLES;

  struct mr_origin o;
  mr_save_origin (&o);

  switch (d) {
  case RIGHT:
    mr_rightmost_cell (&x, &y);
    mr_set_origin (mr.cell[x][y].room, 0, y);
    mr_view_trans (RIGHT);
    break;
  case LEFT:
    mr_leftmost_cell (&x, &y);
    mr_set_origin (mr.cell[x][y].room, mr.w - 1, y);
    mr_view_trans (LEFT);
    break;
  case BELOW:
    mr_bottommost_cell (&x, &y);
    mr_set_origin (mr.cell[x][y].room, x, 0);
    mr_view_trans (BELOW);
    break;
  case ABOVE:
    mr_topmost_cell (&x, &y);
    mr_set_origin (mr.cell[x][y].room, x, mr.h - 1);
    mr_view_trans (ABOVE);
    break;
  }

  mr_stabilize_origin (&o, d);
}
Exemplo n.º 2
0
void
mr_view_page_trans (enum dir d)
{
  int x, y;
  mr.select_cycles = 0;

  switch (d) {
  case RIGHT:
    mr_rightmost_cell (&x, &y);
    mr.room = mr.cell[x][y].room;
    mr.x = 0;
    mr.y = y;
    mr_map_rooms ();
    mr_view_trans (RIGHT);
    break;
  case LEFT:
    mr_leftmost_cell (&x, &y);
    mr.room = mr.cell[x][y].room;
    mr.x = mr.w - 1;
    mr.y = y;
    mr_map_rooms ();
    mr_view_trans (LEFT);
    break;
  case BELOW:
    mr_bottommost_cell (&x, &y);
    mr.room = mr.cell[x][y].room;
    mr.x = x;
    mr.y = 0;
    mr_map_rooms ();
    mr_view_trans (BELOW);
    break;
  case ABOVE:
    mr_topmost_cell (&x, &y);
    mr.room = mr.cell[x][y].room;
    mr.x = x;
    mr.y = mr.h - 1;
    mr_map_rooms ();
    mr_view_trans (ABOVE);
    break;
  }
}