| 309 | } |
| 310 | |
| 311 | static void |
| 312 | write_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 | |
| 348 | static void |
| 349 | remap_colors(void) |