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

Function create_ptank

src/SB/Core/x/xPtankPool.cpp:138–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136 }
137
138 static RpAtomic* create_ptank(U32 flags)
139 {
140 U32 dataFlags = flags | rpPTANKDFLAGSTRUCTURE;
141 RpAtomic* ptank = RpPTankAtomicCreate(MAX_PARTICLES, dataFlags, rpPTANKDFLAGNONE);
142 if (ptank == NULL)
143 {
144 return NULL;
145 }
146
147 RwFrame* frame = RwFrameCreate();
148 if (frame == NULL)
149 {
150 RpPTankAtomicDestroy(ptank);
151 return NULL;
152 }
153
154 const F32 f1 = 1.0f;
155 frame->modelling.right.x = frame->modelling.up.y = frame->modelling.at.z = f1;
156
157 const F32 f0 = 0.0f;
158 frame->modelling.right.y = frame->modelling.right.z = frame->modelling.up.x = f0;
159
160 frame->modelling.up.z = frame->modelling.at.x = frame->modelling.at.y = f0;
161
162 frame->modelling.pos.x = frame->modelling.pos.y = frame->modelling.pos.z = f0;
163
164 frame->modelling.flags = frame->modelling.flags | rpPTANKDFLAGCNS2DROTATE |
165 rpPTANKDFLAGCOLOR | rpPTANKDFLAGPOSITION;
166
167 RpAtomicSetFrame(ptank, frame);
168
169 RpPTankAtomicExtPrv* ext = RPATOMICPTANKPLUGINDATA(ptank);
170 ext->publicData.vertexAlphaBlend = 1;
171
172 return ptank;
173 }
174
175 void destroy_ptank(RpAtomic* ptank)
176 {

Callers 2

create_ptanksFunction · 0.70
grab_blockMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected