| 574 | } |
| 575 | } |
| 576 | void AddProcRandomEmber(int handle, static_proc_element *proc) { |
| 577 | if (proc->frequency == 0 || (FrameCount % proc->frequency) == 0) { |
| 578 | // Add a new fizzle |
| 579 | int num = (prand() % 4) + 1; |
| 580 | for (int i = 0; i < num; i++) { |
| 581 | int index = ProcElementAllocate(); |
| 582 | if (index > -1) { |
| 583 | ProcElementLink(index, handle); |
| 584 | DynamicProcElements[index].type = proc->type; |
| 585 | |
| 586 | DynamicProcElements[index].x1 = IntToFix(proc->x1); |
| 587 | DynamicProcElements[index].y1 = IntToFix(proc->y1); |
| 588 | DynamicProcElements[index].color = BRIGHT_COLOR; |
| 589 | DynamicProcElements[index].speed = proc->speed; |
| 590 | DynamicProcElements[index].frames_left = (prand() % 10) + 15; |
| 591 | } |
| 592 | } |
| 593 | } |
| 594 | } |
| 595 | void DoDynamicRandomEmber(int handle, dynamic_proc_element *proc) { |
| 596 | PlaceProcPoint(FixToInt(proc->x1), FixToInt(proc->y1), proc->color); |
| 597 | proc->frames_left--; |
no test coverage detected