|
JubeatPlus 3.9.11
|
The interleaved sprite-quad vertex and the helper that fills a quad's texture coordinates and colour. More...
#include <cstdint>Go to the source code of this file.
Classes | |
| struct | SpriteVertex |
| One vertex of an interleaved sprite quad: position, texture coordinate, and four 8-bit colour channels. More... | |
Enumerations | |
| enum | SpriteTransform { SpriteTransformNone = 0 , SpriteTransformTranspose = 1 , SpriteTransformRotate180 = 2 , SpriteTransformTransposeFlip = 3 , SpriteTransformMirrorV = 4 , SpriteTransformMirrorU = 5 } |
| How a sprite quad's texture coordinates are permuted across its four vertices. More... | |
Functions | |
| void | SetQuadTexCoordsAndAlpha (float flU0, float flV0, float flU1, float flV1, float flAlpha, SpriteVertex *pQuadVerts, SpriteTransform bTransform) |
| Writes the texture coordinates and packed colour of one four-vertex sprite quad. | |
The interleaved sprite-quad vertex and the helper that fills a quad's texture coordinates and colour.
Reconstructed from Ghidra program Jubeat, image base 0x100000000; all
SpriteVertex nor SetQuadTexCoordsAndAlpha carries RTTI or an embedded __FILE__ path, so the names are inferred from the sole caller (drawSprite:atPoint:scale:rotate:anchor:transform:alpha: (Texture2D)) and the field usage rather than confirmed against runtime metadata. | enum SpriteTransform |
How a sprite quad's texture coordinates are permuted across its four vertices.
Any value outside 0..5 is treated as SpriteTransformNone. The two transposing modes are the pair of 90-degree rotations; which is clockwise depends on the render target's Y-axis direction and so is not distinguished here.
| void SetQuadTexCoordsAndAlpha | ( | float | flU0, |
| float | flV0, | ||
| float | flU1, | ||
| float | flV1, | ||
| float | flAlpha, | ||
| SpriteVertex * | pQuadVerts, | ||
| SpriteTransform | bTransform ) |
Writes the texture coordinates and packed colour of one four-vertex sprite quad.
Clamps flAlpha into [0, 1] (a NaN propagates, matching the binary's unordered compare), lays the (flU0, flV0)-(flU1, flV1) texture rectangle across the four vertices in the order dictated by bTransform, and broadcasts the alpha byte into every RGBA channel of each vertex's colour. The vertices' positions (fX, fY, fZ) are left untouched.
| flU0 | Left texture coordinate, normalised. |
| flV0 | Top texture coordinate, normalised. |
| flU1 | Right texture coordinate, normalised. |
| flV1 | Bottom texture coordinate, normalised. |
| flAlpha | Opacity, clamped to 0..1. |
| pQuadVerts | The first of four consecutive vertices to fill. |
| bTransform | The texture-coordinate permutation to apply. |