MCPcopy Create free account
hub / github.com/NetHack/NetHack / set_map_size

Function set_map_size

win/X11/winmap.c:1628–1647  ·  view source on GitHub ↗

Adjust the number of rows and columns on the given map window */

Source from the content-addressed store, hash-verified

1626
1627/* Adjust the number of rows and columns on the given map window */
1628void
1629set_map_size(struct xwindow *wp, Dimension cols, Dimension rows)
1630{
1631 Arg args[4];
1632 Cardinal num_args;
1633
1634 cols -= COL0_OFFSET;
1635 if (wp->map_information->is_tile) {
1636 wp->pixel_width = wp->map_information->tile_map.square_width * cols;
1637 wp->pixel_height = wp->map_information->tile_map.square_height * rows;
1638 } else {
1639 wp->pixel_width = wp->map_information->text_map.square_width * cols;
1640 wp->pixel_height = wp->map_information->text_map.square_height * rows;
1641 }
1642
1643 num_args = 0;
1644 XtSetArg(args[num_args], XtNwidth, wp->pixel_width); num_args++;
1645 XtSetArg(args[num_args], XtNheight, wp->pixel_height); num_args++;
1646 XtSetValues(wp->w, args, num_args);
1647}
1648
1649static void
1650init_text(struct xwindow *wp)

Callers 3

init_standard_windowsFunction · 0.85
display_map_windowFunction · 0.85
create_map_windowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected