Returns -1 if this name is not already in use, else index of bitmap that is using name
| 630 | } |
| 631 | // Returns -1 if this name is not already in use, else index of bitmap that is using name |
| 632 | int bm_TestName(const char *src) { |
| 633 | uint32_t i, limit; |
| 634 | |
| 635 | char namedest[256]; |
| 636 | char path[256], ext[256], filename[256]; |
| 637 | |
| 638 | ddio_SplitPath(src, path, filename, ext); |
| 639 | limit = BITMAP_NAME_LEN - 7; |
| 640 | // Make sure we don't go over our name length limit |
| 641 | strncpy(namedest, filename, limit); |
| 642 | namedest[limit] = 0; |
| 643 | |
| 644 | int cur_len = strlen(namedest); |
| 645 | |
| 646 | // Now, make sure there are no other bitmaps with this name |
| 647 | strcat(namedest, ".ogf"); |
| 648 | if ((i = bm_FindBitmapName(namedest)) == -1) |
| 649 | return -1; |
| 650 | return i; |
| 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; |
no test coverage detected