| 362 | } |
| 363 | |
| 364 | static int |
| 365 | examine_tilefiles(void) |
| 366 | { |
| 367 | FILE *fp2; |
| 368 | int i, tiles_in_file; |
| 369 | char tilefile_full_path[256]; |
| 370 | |
| 371 | for (i = 0; i < SIZE(tilefilenames[0]); ++i) { |
| 372 | tiles_in_file = 0; |
| 373 | if (!set_tilefile_path(relative_tiledir, |
| 374 | tilefilenames[tilefileset][i], |
| 375 | tilefile_full_path, |
| 376 | sizeof tilefile_full_path)) { |
| 377 | Fprintf(stderr, "tile2bmp path issue %s/%s %d\n", |
| 378 | relative_tiledir, tilefilenames[tilefileset][i], |
| 379 | (int) sizeof tilefile_full_path); |
| 380 | return 0; |
| 381 | } |
| 382 | fp2 = fopen(tilefile_full_path, "r"); |
| 383 | if (fp2) { |
| 384 | char line[256]; |
| 385 | |
| 386 | while (fgets(line, sizeof line, fp2)) { |
| 387 | if (!strncmp(line, "# tile ", 7)) |
| 388 | tiles_in_file++; |
| 389 | } |
| 390 | (void) fclose(fp2); |
| 391 | tilecnt[i] = tiles_in_file; |
| 392 | } |
| 393 | } |
| 394 | return 1; |
| 395 | } |
| 396 | |
| 397 | /*tile2bmp.c*/ |
no test coverage detected