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

Function DoDynamicRisingEmber

Descent3/procedurals.cpp:521–538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

519 }
520}
521void DoDynamicRisingEmber(int handle, dynamic_proc_element *proc) {
522 PlaceProcPoint(FixToInt(proc->x1), FixToInt(proc->y1), proc->color);
523 proc->frames_left--;
524 if (proc->frames_left < 1)
525 ProcElementUnlink(proc - DynamicProcElements, handle);
526 else {
527 proc->color--;
528 if (proc->color == 0)
529 ProcElementUnlink(proc - DynamicProcElements, handle);
530 else {
531 int speed_adjust = 1 + ((proc->speed / 255.0) * 2.0);
532 proc->dx = FloatToFix(((prand() % 3) - 1) * speed_adjust);
533 proc->dy = FloatToFix(((prand() % 3) - 2) * speed_adjust);
534 proc->x1 += proc->dx;
535 proc->y1 += proc->dy;
536 }
537 }
538}
539void AddProcSpinners(int handle, static_proc_element *proc) {
540 if (proc->frequency == 0 || (FrameCount % proc->frequency) == 0) {
541

Callers 1

EvaluateFireProceduralFunction · 0.85

Calls 3

PlaceProcPointFunction · 0.85
ProcElementUnlinkFunction · 0.85
prandFunction · 0.85

Tested by

no test coverage detected