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

Function init_rect

src/rect.c:28–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26 */
27
28void
29init_rect(void)
30{
31 if (!rect) {
32 n_rects = (COLNO * ROWNO) / 30;
33 rect = (NhRect *) alloc(sizeof(NhRect) * n_rects);
34 if (!rect)
35 panic("Could not alloc rect");
36 }
37
38 rect_cnt = 1;
39 rect[0].lx = rect[0].ly = 0;
40 rect[0].hx = COLNO - 1;
41 rect[0].hy = ROWNO - 1;
42}
43
44void
45free_rect(void)

Callers 1

clear_level_structuresFunction · 0.85

Calls 2

allocFunction · 0.70
panicFunction · 0.50

Tested by

no test coverage detected