//////////////////////////////////////////////////////////// //~ Helpers V_ParticleDesc V_DescFromParticleKind(V_ParticleKind kind) { if (kind < 0 || kind >= V_ParticleKind_COUNT) { kind = V_ParticleKind_None; } V_ParticleDesc result; { PERSIST Readonly V_ParticleFlag flags[V_ParticleKind_COUNT] = { #define X(name, flags, stain_rate, pen_rate, r, g, b, a) flags, V_ParticlesXList(X) #undef X }; PERSIST Readonly f32 stain_rates[V_ParticleKind_COUNT] = { #define X(name, flags, stain_rate, pen_rate, r, g, b, a) stain_rate, V_ParticlesXList(X) #undef X }; PERSIST Readonly f32 pen_rates[V_ParticleKind_COUNT] = { #define X(name, flags, stain_rate, pen_rate, r, g, b, a) pen_rate, V_ParticlesXList(X) #undef X }; PERSIST Readonly f32 r[V_ParticleKind_COUNT] = { #define X(name, flags, stain_rate, pen_rate, r, g, b, a) r, V_ParticlesXList(X) #undef X }; PERSIST Readonly f32 g[V_ParticleKind_COUNT] = { #define X(name, flags, stain_rate, pen_rate, r, g, b, a) g, V_ParticlesXList(X) #undef X }; PERSIST Readonly f32 b[V_ParticleKind_COUNT] = { #define X(name, flags, stain_rate, pen_rate, r, g, b, a) b, V_ParticlesXList(X) #undef X }; PERSIST Readonly f32 a[V_ParticleKind_COUNT] = { #define X(name, flags, stain_rate, pen_rate, r, g, b, a) a, V_ParticlesXList(X) #undef X }; result.flags = flags[kind]; result.stain_rate = stain_rates[kind]; result.pen_rate = pen_rates[kind]; result.color = LinearFromSrgb(VEC4(r[kind], g[kind], b[kind], a[kind])); } return result; }