Given a filename, loads either the bitmap or vclip found in that file. If type is not NULL, sets it to 1 if file is animation, otherwise sets it to zero
| 580 | // Given a filename, loads either the bitmap or vclip found in that file. If type |
| 581 | // is not NULL, sets it to 1 if file is animation, otherwise sets it to zero |
| 582 | int LoadWeaponHudImage(char *filename, int *type) { |
| 583 | int anim = 0, bm_handle; |
| 584 | char extension[10]; |
| 585 | |
| 586 | int len = strlen(filename); |
| 587 | |
| 588 | if (len < 4) |
| 589 | return -1; |
| 590 | |
| 591 | strncpy(extension, &filename[len - 3], 5); |
| 592 | |
| 593 | if ((!strnicmp("oaf", extension, 3)) || (!strnicmp("ifl", extension, 3)) || (!strnicmp("abm", extension, 3))) |
| 594 | anim = 1; |
| 595 | |
| 596 | if (type != NULL) |
| 597 | *type = anim; |
| 598 | |
| 599 | if (anim) |
| 600 | bm_handle = AllocLoadVClip(IGNORE_TABLE(filename), NOT_TEXTURE, 0); |
| 601 | else |
| 602 | bm_handle = bm_AllocLoadFileBitmap(IGNORE_TABLE(filename), 0); |
| 603 | |
| 604 | return bm_handle; |
| 605 | } |
| 606 | |
| 607 | // Given a weapon handle, returns that weapons discharge bitmap |
| 608 | int GetWeaponFireImage(int handle, int frame) { |
no test coverage detected