| 32 | } |
| 33 | |
| 34 | static 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; |
no test coverage detected