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

Function vision_init

src/vision.c:120–142  ·  view source on GitHub ↗

* vision_init() * * The one-time vision initialization routine. * * This must be called before mklev() is called in newgame() [allmain.c], * or before a game restore. Else we die a horrible death. */

Source from the content-addressed store, hash-verified

118 * or before a game restore. Else we die a horrible death.
119 */
120void
121vision_init(void)
122{
123 int i;
124
125 /* Set up the pointers. */
126 for (i = 0; i < ROWNO; i++) {
127 cs_rows0[i] = could_see[0][i];
128 cs_rows1[i] = could_see[1][i];
129 viz_clear_rows[i] = viz_clear[i];
130 }
131
132 /* Start out with cs0 as our current array */
133 gv.viz_array = cs_rows0;
134 gv.viz_rmin = cs_rmin0;
135 gv.viz_rmax = cs_rmax0;
136
137 gv.vision_full_recalc = 0;
138 (void) memset((genericptr_t) could_see, 0, sizeof(could_see));
139
140 /* Initialize the vision algorithm (currently C). */
141 view_init();
142}
143
144/*
145 * does_block()

Callers 7

mainFunction · 0.85
libnhmain.cFile · 0.85
MAINFunction · 0.85
mainFunction · 0.85
pcmainFunction · 0.85
MAINFunction · 0.85
mainFunction · 0.85

Calls 1

view_initFunction · 0.85

Tested by

no test coverage detected