| 447 | } |
| 448 | |
| 449 | static void CustomParticle_Render(struct CustomParticle* p, float t, struct VertexTextured* vertices) { |
| 450 | struct CustomParticleEffect* e = &Particles_CustomEffects[p->effectId]; |
| 451 | Vec3 pos; |
| 452 | Vec2 size; |
| 453 | PackedCol col; |
| 454 | TextureRec rec = e->rec; |
| 455 | int x, y, z; |
| 456 | |
| 457 | float time_lived = p->totalLifespan - p->base.lifetime; |
| 458 | int curFrame = Math_Floor(e->frameCount * (time_lived / p->totalLifespan)); |
| 459 | float shiftU = curFrame * (rec.u2 - rec.u1); |
| 460 | |
| 461 | rec.u1 += shiftU;/* * 0.0078125f; */ |
| 462 | rec.u2 += shiftU;/* * 0.0078125f; */ |
| 463 | |
| 464 | Vec3_Lerp(&pos, &p->base.lastPos, &p->base.nextPos, t); |
| 465 | size.x = p->base.size; size.y = size.x; |
| 466 | |
| 467 | x = Math_Floor(pos.x); y = Math_Floor(pos.y); z = Math_Floor(pos.z); |
| 468 | col = e->fullBright ? PACKEDCOL_WHITE : Lighting.Color(x, y, z); |
| 469 | col = PackedCol_Tint(col, e->tintCol); |
| 470 | |
| 471 | Particle_DoRender(&size, &pos, &rec, col, vertices); |
| 472 | } |
| 473 | |
| 474 | static void Custom_Render(float t) { |
| 475 | struct VertexTextured* data; |
no test coverage detected