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

Function half_img

outdated/win/gem/load_img.c:293–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291}
292
293int
294half_img(MFDB *s, MFDB *d)
295{
296 int pxy[8], i, j;
297 MFDB tmp;
298
299 mfdb(&tmp, NULL, s->fd_w / 2, s->fd_h, s->fd_stand, s->fd_nplanes);
300 tmp.fd_w = s->fd_w / 2;
301 tmp.fd_addr = calloc(1, mfdb_size(&tmp));
302 if (!tmp.fd_addr)
303 return (FALSE);
304
305 pxy[1] = pxy[5] = 0;
306 pxy[3] = pxy[7] = s->fd_h - 1;
307 for (i = 0; i < s->fd_w / 2; i++) {
308 pxy[0] = pxy[2] = 2 * i;
309 pxy[4] = pxy[6] = i;
310 vro_cpyfm(x_handle, S_ONLY, pxy, s, &tmp);
311 }
312 pxy[0] = pxy[4] = 0;
313 pxy[2] = pxy[6] = s->fd_w / 2 - 1;
314 for (j = 0; j < s->fd_h / 2; j++) {
315 pxy[1] = pxy[3] = 2 * j;
316 pxy[5] = pxy[7] = j;
317 vro_cpyfm(x_handle, S_ONLY, pxy, &tmp, d);
318 }
319 free(tmp.fd_addr);
320 return (TRUE);
321}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected