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

Function write_tibtile

sys/msdos/tile2bin.c:311–346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

309}
310
311static void
312write_tibtile(int recnum)
313{
314 long fpos;
315
316#ifdef PLANAR_FILE
317#ifndef OVERVIEW_FILE
318 fpos = ((long) (recnum) * (long) sizeof(struct planar_cell_struct))
319 + (long) TIBHEADER_SIZE;
320#else
321 fpos =
322 ((long) (recnum) * (long) sizeof(struct overview_planar_cell_struct))
323 + (long) TIBHEADER_SIZE;
324#endif
325 if (fseek(tibfile1, fpos, SEEK_SET)) {
326 Fprintf(stderr, "Error seeking before planar tile write %d\n",
327 recnum);
328 }
329#ifndef OVERVIEW_FILE
330 fwrite(&planetile, sizeof(struct planar_cell_struct), 1, tibfile1);
331#else
332 fwrite(&planetile, sizeof(struct overview_planar_cell_struct), 1,
333 tibfile1);
334#endif
335#endif
336
337#ifdef PACKED_FILE
338 fpos =
339 ((long) (recnum) * (long) sizeof(packtile)) + (long) TIBHEADER_SIZE;
340 if (fseek(tibfile2, fpos, SEEK_SET)) {
341 Fprintf(stderr, "Error seeking before packed tile write %d\n",
342 recnum);
343 }
344 fwrite(&packtile, sizeof(packtile), 1, tibfile2);
345#endif
346}
347
348static void
349remap_colors(void)

Callers 1

mainFunction · 0.85

Calls 2

fseekFunction · 0.85
fwriteFunction · 0.85

Tested by

no test coverage detected