198{
199 [super update:delta_t];
200
201
205
207 NSString *color_order = [_settings oo_stringForKey:kExplosionColors defaultValue:@"rgb"];
208 NSUInteger primary = 0, secondary = 1, tertiary = 2;
209
210 if ([color_order isEqualToString:@"rgb"])
211 {
212 primary = 0;
213 secondary = 1;
214 tertiary = 2;
215 }
216 else if ([color_order isEqualToString:@"rbg"])
217 {
218 primary = 0;
219 secondary = 2;
220 tertiary = 1;
221 }
222 else if ([color_order isEqualToString:@"grb"])
223 {
224 primary = 1;
225 secondary = 0;
226 tertiary = 2;
227 }
228 else if ([color_order isEqualToString:@"gbr"])
229 {
230 primary = 1;
231 secondary = 2;
232 tertiary = 0;
233 }
234 else if ([color_order isEqualToString:@"brg"])
235 {
236 primary = 2;
237 secondary = 0;
238 tertiary = 1;
239 }
240 else if ([color_order isEqualToString:@"bgr"])
241 {
242 primary = 2;
243 secondary = 1;
244 tertiary = 0;
245 }
246
247
248 float fdelta_t = delta_t;
249 for (i=0;i<
count;i++) {
250
252
253 particleColor[i][3] = newAlpha;
254 if (![color_order isEqualToString:@"white"])
255 {
256
257 if (particleColor[i][tertiary] > 0.0f)
258 {
259 particleColor[i][tertiary] -= fdelta_t * 0.5f * fadeRate;
260 if (particleColor[i][tertiary] < 0.0f)
261 {
262 particleColor[i][tertiary] = 0.0f;
263 }
264 }
265 else if (particleColor[i][secondary] > 0.0f)
266 {
267 particleColor[i][secondary] -= fdelta_t * fadeRate;
268 if (particleColor[i][secondary] < 0.0f)
269 {
270 particleColor[i][secondary] = 0.0f;
271 }
272 }
273 else if (particleColor[i][primary] > 0.0f)
274 {
275 particleColor[i][primary] -= fdelta_t * 2.0f * fadeRate;
276 if (particleColor[i][primary] < 0.0f)
277 {
278 particleColor[i][primary] = 0.0f;
279 }
280 }
281
282 }
283 }
284
285}
GLfloat _particleSize[kFragmentBurstMaxParticles]