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

Method update

src/SB/Core/x/xDecal.cpp:223–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221} // end of anonymous namespace
222
223void xDecalEmitter::update(F32 dt)
224{
225 // Unused from DWARF
226 // xVec4* _loc; // r2
227 // F32 par_dist; // r1
228
229 debug_update(dt);
230 F32 dage = dt * this->ilife;
231
232 ptank_pool__color_mat_uv2 pool;
233 pool.reset();
234
235 pool.rs.texture = this->texture.asset;
236 pool.rs.src_blend = this->cfg.blend_src;
237 pool.rs.dst_blend = this->cfg.blend_dst;
238 pool.rs.flags = this->cfg.flags & 0x1;
239 this->curve_index = 0;
240
241 static_queue<unit_data>::iterator it = this->units.begin();
242 while (it != this->units.end())
243 {
244 unit_data& unit = *it;
245 unit.age += dage;
246
247 if (unit.age >= 1.0f)
248 {
249 break;
250 }
251
252 update_frac(unit);
253 curve_node& node0 = this->curve[unit.curve_index];
254 curve_node& node1 = this->curve[unit.curve_index+1];
255
256 F32 scale;
257 lerp(scale, unit.frac, node0.scale, node1.scale);
258
259 *((F32*)&unit.mat.pos.z + 1) = unit.cull_size * scale;
260 pool.next();
261 if (!pool.valid())
262 {
263 break;
264 }
265
266 get_render_data(unit, scale, pool.color[0], pool.mat[0], pool.uv[0], pool.uv[1]);
267
268 ++it;
269 }
270
271 pool.flush();
272 this->units.erase(it, this->units.end());
273}
274
275namespace
276{

Callers 3

updaterMethod · 0.45
operator()Method · 0.45
xDecalUpdateFunction · 0.45

Calls 9

debug_updateFunction · 0.85
validMethod · 0.80
eraseMethod · 0.80
lerpFunction · 0.70
resetMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
nextMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected