display/source/CursesDisplay.cpp
// Draw the specified Display in the term.  This'll be a simplified
// map that contains only the information needed by the display -
// no specific creature, etc., data.
Draw the specified Display in the term.  This'll be a simplified
map that contains only the information needed by the display
no specific creature, etc., data.
Draw the specified Display in the term . This ' ll be a simplified map that contains only the information needed by the display no specific creature etc . data .
void CursesDisplay::draw(const DisplayMap& current_map, const CursorSettings cs)
{
  refresh_terminal_size();
  DisplayTile display_tile;
  Coordinate map_coords;
  Dimensions d = current_map.size();
  unsigned int map_rows = d.get_y();
  unsigned int map_cols = d.get_x();
  for (unsigned int terminal_row = CursesConstants::MAP_START_ROW; terminal_row < map_rows + CursesConstants::MAP_START_ROW; terminal_row++)
  {
    for (unsigned int terminal_col = CursesConstants::MAP_START_COL; terminal_col < map_cols + CursesConstants::MAP_START_COL; terminal_col++)
    {
      map_coords.first = terminal_row - CursesConstants::MAP_START_ROW;
      map_coords.second = terminal_col - CursesConstants::MAP_START_COL;
      DisplayTile tile = current_map.at(map_coords);
      draw_coordinate(tile, terminal_row, terminal_col);
    }
  }
  Coordinate cursor_coord = current_map.get_cursor_coordinate();
  curs_set(get_cursor_mode(cs));
  move(cursor_coord.first+CursesConstants::MAP_START_ROW, cursor_coord.second+CursesConstants::MAP_START_COL);
  wredrawln(stdscr, CursesConstants::MAP_START_ROW, map_rows);
  refresh();
}
void CursesDisplay :: draw ( const DisplayMap & current_map , const CursorSettings cs ) { refresh_terminal_size ( ) ; DisplayTile display_tile ; Coordinate map_coords ; Dimensions d = current_map . size ( ) ; unsigned int map_rows = d . get_y ( ) ; unsigned int map_cols = d . get_x ( ) ; for ( unsigned int terminal_row = CursesConstants :: MAP_START_ROW ; terminal_row < map_rows + CursesConstants :: MAP_START_ROW ; terminal_row ++ ) { for ( unsigned int terminal_col = CursesConstants :: MAP_START_COL ; terminal_col < map_cols + CursesConstants :: MAP_START_COL ; terminal_col ++ ) { map_coords . first = terminal_row - CursesConstants :: MAP_START_ROW ; map_coords . second = terminal_col - CursesConstants :: MAP_START_COL ; DisplayTile tile = current_map . at ( map_coords ) ; draw_coordinate ( tile , terminal_row , terminal_col ) ; } } Coordinate cursor_coord = current_map . get_cursor_coordinate ( ) ; curs_set ( get_cursor_mode ( cs ) ) ; move ( cursor_coord . first + CursesConstants :: MAP_START_ROW , cursor_coord . second + CursesConstants :: MAP_START_COL ) ; wredrawln ( stdscr , CursesConstants :: MAP_START_ROW , map_rows ) ; refresh ( ) ; }
Draw the specified Display in the term.
Draw the specified Display in the term .
// Since we're drawing the map (with, presumably, the player) we need the cursor present to show the // position of the player's character.