* Start a Explosion on a tile. * @param explosionType Type of Explosion. * @param position The position to use for init. */
| 280 | * @param position The position to use for init. |
| 281 | */ |
| 282 | void Explosion_Start(uint16 explosionType, tile32 position) |
| 283 | { |
| 284 | const ExplosionCommandStruct *commands; |
| 285 | uint16 packed; |
| 286 | uint8 i; |
| 287 | |
| 288 | if (explosionType > EXPLOSION_SPICE_BLOOM_TREMOR) return; |
| 289 | commands = g_table_explosion[explosionType]; |
| 290 | |
| 291 | packed = Tile_PackTile(position); |
| 292 | |
| 293 | Explosion_StopAtPosition(packed); |
| 294 | |
| 295 | for (i = 0; i < EXPLOSION_MAX; i++) { |
| 296 | Explosion *e; |
| 297 | |
| 298 | e = &g_explosions[i]; |
| 299 | |
| 300 | if (e->commands != NULL) continue; |
| 301 | |
| 302 | e->commands = commands; |
| 303 | e->current = 0; |
| 304 | e->spriteID = 0; |
| 305 | e->position = position; |
| 306 | e->isDirty = false; |
| 307 | e->timeOut = g_timerGUI; |
| 308 | s_explosionTimer = 0; |
| 309 | g_map[packed].hasExplosion = true; |
| 310 | |
| 311 | break; |
| 312 | } |
| 313 | } |
| 314 | |
| 315 | /** |
| 316 | * Timer tick for explosions. |
no test coverage detected