()
| 1523 | * ================= CL_AddExplosions ================= |
| 1524 | */ |
| 1525 | static void AddExplosions() { |
| 1526 | entity_t ent; |
| 1527 | int i; |
| 1528 | explosion_t[] ex; |
| 1529 | float frac; |
| 1530 | int f; |
| 1531 | |
| 1532 | //memset (&ent, 0, sizeof(ent)); Pointer! |
| 1533 | ent = null; |
| 1534 | ex = cl_explosions; |
| 1535 | for (i = 0; i < MAX_EXPLOSIONS; i++) { |
| 1536 | if (ex[i].type == ex_free) |
| 1537 | continue; |
| 1538 | frac = (ClientGlobals.cl.time - ex[i].start) / 100.0f; |
| 1539 | f = (int) Math.floor(frac); |
| 1540 | |
| 1541 | ent = ex[i].ent; |
| 1542 | |
| 1543 | switch (ex[i].type) { |
| 1544 | case ex_mflash: |
| 1545 | if (f >= ex[i].frames - 1) |
| 1546 | ex[i].type = ex_free; |
| 1547 | break; |
| 1548 | case ex_misc: |
| 1549 | if (f >= ex[i].frames - 1) { |
| 1550 | ex[i].type = ex_free; |
| 1551 | break; |
| 1552 | } |
| 1553 | ent.alpha = 1.0f - frac / (ex[i].frames - 1); |
| 1554 | break; |
| 1555 | case ex_flash: |
| 1556 | if (f >= 1) { |
| 1557 | ex[i].type = ex_free; |
| 1558 | break; |
| 1559 | } |
| 1560 | ent.alpha = 1.0f; |
| 1561 | break; |
| 1562 | case ex_poly: |
| 1563 | if (f >= ex[i].frames - 1) { |
| 1564 | ex[i].type = ex_free; |
| 1565 | break; |
| 1566 | } |
| 1567 | |
| 1568 | ent.alpha = (16.0f - (float) f) / 16.0f; |
| 1569 | |
| 1570 | if (f < 10) { |
| 1571 | ent.skinnum = (f >> 1); |
| 1572 | if (ent.skinnum < 0) |
| 1573 | ent.skinnum = 0; |
| 1574 | } else { |
| 1575 | ent.flags |= Defines.RF_TRANSLUCENT; |
| 1576 | if (f < 13) |
| 1577 | ent.skinnum = 5; |
| 1578 | else |
| 1579 | ent.skinnum = 6; |
| 1580 | } |
| 1581 | break; |
| 1582 | case ex_poly2: |
no test coverage detected