MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / LoadWeaponFireImage

Function LoadWeaponFireImage

Descent3/weapon.cpp:628–655  ·  view source on GitHub ↗

Given a filename, loads either the bitmap or model found in that file. If type is not NULL, sets it to 1 if file is model, otherwise sets it to zero

Source from the content-addressed store, hash-verified

626// Given a filename, loads either the bitmap or model found in that file. If type
627// is not NULL, sets it to 1 if file is model, otherwise sets it to zero
628int LoadWeaponFireImage(char *filename, int *type, int *anim, int pageable) {
629 int model = 0, bm_handle;
630 int is_vclip = 0;
631 char extension[10];
632
633 int len = strlen(filename);
634
635 if (len < 4)
636 return -1;
637
638 strncpy(extension, &filename[len - 3], 5);
639
640 if ((!strnicmp("pof", extension, 3)) || (!strnicmp("oof", extension, 3)))
641 model = 1;
642
643 if (type != NULL)
644 *type = model;
645 if (anim != NULL)
646 *anim = is_vclip;
647
648 if (model)
649 bm_handle = LoadPolyModel(IGNORE_TABLE(filename), 0);
650 else {
651 bm_handle = LoadTextureImage(IGNORE_TABLE(filename), anim, NOT_TEXTURE, 0);
652 }
653
654 return bm_handle;
655}
656
657// Given a weapon name, assigns that weapon to a specific index into
658// the Weapons array. Returns -1 if the named weapon is not found, 0 if the weapon

Callers 2

OnAddWeaponMethod · 0.85
OnLoadWeaponDischargeMethod · 0.85

Calls 2

LoadPolyModelFunction · 0.85
LoadTextureImageFunction · 0.85

Tested by

no test coverage detected