Skip to navigation

Particles: AddExhaustParticleToBuffer

Name: AddExhaustParticleToBuffer [Show more] Type: Subroutine Category: Particles Summary: Add one of the moving particles in the exhaust plume to the particle data buffer Deep dive: Particles and particle clouds Flying by mouse
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * MoveAndDrawPlayer (Part 4 of 5) calls AddExhaustParticleToBuffer

Arguments: (R0, R1, R2) Particle coordinate (R3, R4, R5) Particle velocity R6 Particle lifespan counter (i.e. how many iterations around the main loop before the particle expires) R7 Particle flags R8 Magnitude of the random element that's added to the velocity, with a larger figure giving a smaller random element; the actual range is +/- 2^(32 - R8) R9 Magnitude of the random element that's added to the particle lifespan, with a larger figure giving a smaller random element; the actual range is 0 to 2^(32 - R9)
.AddExhaustParticleToBuffer STMFD R13!, {R8, R14} \ Store R8 and the return address on the \ stack, so the following call to the \ particle adding routine below can return \ properly B AddMovingParticleToBuffer \ Add a moving particle to the particle data \ buffer that starts off moving along the \ exhaust vector, and with a random element \ being added to its velocity and lifespan \ counter, returning from the subroutine \ using a tail call