MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / par_sprite_update

Function par_sprite_update

src/SB/Core/x/xParSys.cpp:34–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34static void par_sprite_update(xParSys& sys, xParGroup& group)
35{
36 if (!using_ptank_render(*sys.tasset))
37 {
38 return;
39 }
40
41 U32 pivot = sys.tasset->parFlags;
42 xVec3 offset_right;
43 if (pivot & 0x8)
44 {
45 offset_right = par_offset_right;
46 }
47 else if (pivot & 0x20)
48 {
49 offset_right = -par_offset_right;
50 }
51 else
52 {
53 offset_right = 0.0f;
54 }
55
56 xVec3 offset_up;
57 if (pivot & 0x10)
58 {
59 offset_up = -par_offset_up;
60 }
61 else if (pivot & 0x40)
62 {
63 offset_up = par_offset_up;
64 }
65 else
66 {
67 offset_up = 0.0f;
68 }
69
70 ptank_pool__pos_color_size_uv2 pool;
71 pool.rs.texture = sys.txtr_particle;
72 pool.rs.src_blend = sBlendTable[sys.tasset->renderSrcBlendMode];
73 pool.rs.dst_blend = sBlendTable[sys.tasset->renderDstBlendMode];
74 pool.rs.flags = 0x0;
75 pool.reset();
76
77 xParCmdTex* tex = group.m_cmdTex;
78 xPar* p = group.m_root;
79 while (p != NULL)
80 {
81 RwSphere testSphere;
82 testSphere.center = *(RwV3d*)&p->m_pos;
83 testSphere.radius = p->m_size;
84
85 if (RwCameraFrustumTestSphere(globals.camera.lo_cam, &testSphere))
86 {
87 pool.next();
88
89 if (!pool.valid())
90 {
91 break;

Callers 1

xParSysUpdateFunction · 0.70

Calls 5

using_ptank_renderFunction · 0.85
validMethod · 0.80
resetMethod · 0.45
nextMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected