|
resonance 1.0.1
|

Go to the source code of this file.
Classes | |
| struct | Color |
| Linear colour with four float components. More... | |
Functions | |
| void | ClampColorToUnitRange (const Color &source, Color &result) |
| Clamp all four components of a colour to the unit range. | |
| void | AddColor (const Color &left, const Color &right, Color &result) |
| Add two colours component by component. | |
| void | SubColor (const Color &left, const Color &right, Color &result) |
| Subtract one colour from another component by component. | |
| void | ScaleColor (const Color &source, float flScale, Color &result) |
| Scale all four components of a colour by one factor. | |
Clamp all four components of a colour to the unit range.
The vector unit raises the floor with a maximum against a zero broadcast and lowers the ceiling with a minimum against a 1.0f broadcast, then stores the result as one quadword. All four components pass through both stages, so the alpha word is clamped along with the three colour words. The one caller is Rnd::PsMesh::RefreshAfterLoad().
The title is inferred. No literal in the image identifies the routine.
| source | The colour to clamp. |
| result | Receives the clamped colour. It may alias the source. |
Add two colours component by component.
The result is a parameter rather than a return value, and that is measured rather than assumed. A by-value operator in this ABI receives a hidden result pointer as its first argument and hands it back in the return register, whereas this routine writes through its third argument and never writes the return register at all. So it is a named routine of three parameters and not operator+.
Both call paths operate on colours. The particle system interpolates a colour with it, and the mesh weld path sums vertex colours, reaching each one at the colour offset of a vertex.
The title is inferred. No literal in the image identifies either routine, and nothing distinguishes an addition named this way from one named any other way.
| left | The first colour. |
| right | The second colour. |
| result | Receives the sum. It may alias either operand, and the mesh weld path passes the same address as both the first operand and the result. |
Subtract one colour from another component by component.
The body is the addition above with a subtracting operation in place of the adding one, and the same reasoning fixes its shape and leaves its title inferred.
| left | The colour subtracted from. |
| right | The colour to subtract. |
| result | Receives the difference. It may alias either operand. |
Scale all four components of a colour by one factor.
The factor arrives in the first floating-point argument register, which consumes no integer argument register, so its position among the parameters is not recoverable from the body. It is placed second to match Vec3Scale(). All four loads precede all four stores.
The title is inferred. No literal in the image identifies the routine.
| source | The colour to scale. |
| flScale | The factor applied to every component, alpha included. |
| result | Receives the scaled colour. It may alias the source. |