| 2463 | } |
| 2464 | |
| 2465 | void DrawBlobbyWeaponRing(object *obj) { |
| 2466 | vector vecs[30]; |
| 2467 | float lifenorm = (obj->lifetime - obj->lifeleft) / obj->lifetime; |
| 2468 | int i; |
| 2469 | |
| 2470 | int bm_handle; |
| 2471 | int num_segments = 20; |
| 2472 | |
| 2473 | int ring_increment = 65536 / num_segments; |
| 2474 | int ring_angle = 0; |
| 2475 | |
| 2476 | if (lifenorm >= 1.0) |
| 2477 | lifenorm = .999f; |
| 2478 | |
| 2479 | if (Weapons[obj->id].flags & WF_IMAGE_BITMAP) |
| 2480 | bm_handle = GetWeaponFireImage(obj->id, 0); |
| 2481 | else { |
| 2482 | vclip *vc = &GameVClips[Weapons[obj->id].fire_image_handle]; |
| 2483 | int int_frame = vc->num_frames * lifenorm; |
| 2484 | bm_handle = vc->frames[int_frame]; |
| 2485 | } |
| 2486 | |
| 2487 | rend_SetLighting(LS_NONE); |
| 2488 | rend_SetTextureType(TT_LINEAR); |
| 2489 | rend_SetAlphaType(AT_CONSTANT_TEXTURE); |
| 2490 | rend_SetAlphaValue((1.0 - lifenorm) * 255.0); |
| 2491 | |
| 2492 | // Now draw a ring of blobs |
| 2493 | ring_angle = 0; |
| 2494 | float blob_size = (obj->size / 4); |
| 2495 | |
| 2496 | for (i = 0; i < num_segments; i++, ring_angle += ring_increment) { |
| 2497 | float ring_sin = FixSin(ring_angle); |
| 2498 | float ring_cos = FixCos(ring_angle); |
| 2499 | |
| 2500 | vecs[i] = obj->orient.rvec * (ring_cos * obj->size); |
| 2501 | vecs[i] += obj->orient.uvec * (ring_sin * obj->size); |
| 2502 | vecs[i] += obj->pos; |
| 2503 | |
| 2504 | g3_DrawRotatedBitmap(&vecs[i], ring_angle, blob_size, (blob_size * bm_h(bm_handle, 0)) / bm_w(bm_handle, 0), |
| 2505 | bm_handle); |
| 2506 | } |
| 2507 | } |
| 2508 | |
| 2509 | void DrawPolygonalWeaponRing(object *obj) { |
| 2510 | vector inner_vecs[30], outer_vecs[30]; |
no test coverage detected