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

Function GetWeaponFireImage

Descent3/weapon.cpp:608–624  ·  view source on GitHub ↗

Given a weapon handle, returns that weapons discharge bitmap

Source from the content-addressed store, hash-verified

606
607// Given a weapon handle, returns that weapons discharge bitmap
608int GetWeaponFireImage(int handle, int frame) {
609 if (Weapons[handle].flags & WF_IMAGE_VCLIP) {
610 float cur_frametime;
611 int int_frame;
612
613 PageInVClip(Weapons[handle].fire_image_handle);
614
615 vclip *vc = &GameVClips[Weapons[handle].fire_image_handle];
616 ASSERT(vc->used >= 1);
617
618 cur_frametime = Gametime / vc->frame_time;
619 int_frame = cur_frametime;
620 int_frame += frame;
621 return (vc->frames[int_frame % vc->num_frames]);
622 } else
623 return (Weapons[handle].fire_image_handle);
624}
625
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

Callers 4

UpdateWeaponViewMethod · 0.85
DrawElectricalWeaponFunction · 0.85
DrawBlobbyWeaponRingFunction · 0.85
DrawWeaponObjectFunction · 0.85

Calls 1

PageInVClipFunction · 0.85

Tested by

no test coverage detected