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

Function DoDynamicRandomEmber

Descent3/procedurals.cpp:595–612  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

593 }
594}
595void DoDynamicRandomEmber(int handle, dynamic_proc_element *proc) {
596 PlaceProcPoint(FixToInt(proc->x1), FixToInt(proc->y1), proc->color);
597 proc->frames_left--;
598 if (proc->frames_left < 1)
599 ProcElementUnlink(proc - DynamicProcElements, handle);
600 else {
601 proc->color--;
602 if (proc->color == 0)
603 ProcElementUnlink(proc - DynamicProcElements, handle);
604 else {
605 int speed_adjust = 1 + ((proc->speed / 255.0) * 2.0);
606 proc->dx = FloatToFix(((prand() % 3) - 1) * speed_adjust);
607 proc->dy = FloatToFix(((prand() % 3) - 1) * speed_adjust);
608 proc->x1 += proc->dx;
609 proc->y1 += proc->dy;
610 }
611 }
612}
613void AddProcRoamers(int handle, static_proc_element *proc) {
614 proc->x1 += (ps_rand() % 5) - 2;
615 proc->y1 += (ps_rand() % 5) - 2;

Callers 1

EvaluateFireProceduralFunction · 0.85

Calls 3

PlaceProcPointFunction · 0.85
ProcElementUnlinkFunction · 0.85
prandFunction · 0.85

Tested by

no test coverage detected