gets the filename from a path, plus appends our .ogf extension
| 651 | } |
| 652 | // gets the filename from a path, plus appends our .ogf extension |
| 653 | void bm_ChangeEndName(const char *src, char *dest) { |
| 654 | uint32_t i, limit; |
| 655 | int last = -1; |
| 656 | int curnum = -1; |
| 657 | char namedest[256 + 16]; |
| 658 | char path[256], ext[256], filename[256]; |
| 659 | |
| 660 | ddio_SplitPath(src, path, filename, ext); |
| 661 | limit = BITMAP_NAME_LEN - 7; |
| 662 | // Make sure we don't go over our name length limit |
| 663 | filename[limit] = 0; |
| 664 | Start: |
| 665 | if (curnum != -1) |
| 666 | snprintf(namedest, sizeof(namedest), "%s%d", filename, curnum); |
| 667 | else |
| 668 | strcpy(namedest, filename); |
| 669 | // Now, make sure there are no other bitmaps with this name |
| 670 | strcat(namedest, ".ogf"); |
| 671 | if ((i = bm_FindBitmapName(namedest)) != -1) { |
| 672 | curnum++; |
| 673 | // This name is already taken. Try same name with different number |
| 674 | // appended |
| 675 | goto Start; |
| 676 | } |
| 677 | strcpy(dest, namedest); |
| 678 | } |
| 679 | // Checks to see if this file is a kind we can read |
| 680 | int bm_GetFileType(CFILE *infile, const char *dest) { |
| 681 | char iffcheck[4]; |
no test coverage detected