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

Function ReadPlanarTileFile

sys/msdos/pctiles.c:188–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186 */
187#ifdef PLANAR_FILE
188int
189ReadPlanarTileFile(int tilenum, struct planar_cell_struct **gp)
190{
191 long fpos;
192
193#ifdef TILES_IN_RAM
194 if (tiles_in_ram) {
195 *gp = ramtiles + tilenum;
196 return 0;
197 }
198#endif
199 fpos = ((long) (tilenum) * (long) sizeof(struct planar_cell_struct))
200 + (long) TIBHEADER_SIZE;
201 if (fseek(tilefile, fpos, SEEK_SET)) {
202 return 1;
203 } else {
204 fread(&plancell, sizeof(struct planar_cell_struct), 1, tilefile);
205 }
206 *gp = &plancell;
207 return 0;
208}
209int
210ReadPlanarTileFile_O(int tilenum, struct overview_planar_cell_struct **gp)
211{

Callers

nothing calls this directly

Calls 2

fseekFunction · 0.85
freadFunction · 0.85

Tested by

no test coverage detected