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

Function WBFireAnimFrame

Descent3/robotfire.cpp:81–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81void WBFireAnimFrame(object *obj, otype_wb_info *static_wb, int wb_index) {
82 dynamic_wb_info *p_dwb = &obj->dynamic_wb[wb_index];
83 const int cur_mask = p_dwb->wb_anim_mask;
84
85 p_dwb->wb_anim_frame += Frametime * ((static_wb->anim_end_frame[cur_mask] - static_wb->anim_start_frame[cur_mask]) /
86 static_wb->anim_time[cur_mask]);
87
88 if ((p_dwb->flags & DWBF_ANIM_FIRED) == 0) {
89 if (p_dwb->wb_anim_frame >= static_wb->anim_fire_frame[cur_mask]) {
90 WBFireBattery(obj, static_wb, wb_index);
91 p_dwb->flags |= DWBF_ANIM_FIRED;
92 }
93 }
94
95 if (p_dwb->wb_anim_frame >= static_wb->anim_end_frame[cur_mask]) {
96 p_dwb->wb_anim_frame = 0.0;
97 p_dwb->flags &= ~(DWBF_ANIM_FIRED | DWBF_ANIMATING);
98 }
99}
100
101bool WBIsBatteryReady(object *obj, otype_wb_info *static_wb, int wb_index) {
102 dynamic_wb_info *p_dwb = &obj->dynamic_wb[wb_index];

Callers 1

ai_do_animationFunction · 0.85

Calls 1

WBFireBatteryFunction · 0.85

Tested by

no test coverage detected