JubeatPlus 3.9.11
Loading...
Searching...
No Matches
sprite_vertex.h File Reference

The interleaved sprite-quad vertex and the helper that fills a quad's texture coordinates and colour. More...

#include <cstdint>
Include dependency graph for sprite_vertex.h:

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.

Detailed Description

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

Ghidra address:
values are offsets relative to that base. Neither 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.

Enumeration Type Documentation

◆ 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.

Enumerator
SpriteTransformNone 

Identity: no rotation or mirroring.

SpriteTransformTranspose 

Transposed (the U and V axes swapped).

SpriteTransformRotate180 

Rotated 180 degrees.

SpriteTransformTransposeFlip 

Transposed the other way.

SpriteTransformMirrorV 

Mirrored in the V (vertical) texture axis.

SpriteTransformMirrorU 

Mirrored in the U (horizontal) texture axis.

Function Documentation

◆ SetQuadTexCoordsAndAlpha()

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.

Parameters
flU0Left texture coordinate, normalised.
flV0Top texture coordinate, normalised.
flU1Right texture coordinate, normalised.
flV1Bottom texture coordinate, normalised.
flAlphaOpacity, clamped to 0..1.
pQuadVertsThe first of four consecutive vertices to fill.
bTransformThe texture-coordinate permutation to apply.
Ghidra address:
0xea2c
Ghidra address:
0xea2c