MCPcopy Create free account
hub / github.com/OpenDUNE/OpenDUNE / Explosion_Func_SetAnimation

Function Explosion_Func_SetAnimation

src/explosion.c:175–188  ·  view source on GitHub ↗

* Set the animation of a Explosion. * @param e The Explosion to change. * @param animationMapID The animation map to use. */

Source from the content-addressed store, hash-verified

173 * @param animationMapID The animation map to use.
174 */
175static void Explosion_Func_SetAnimation(Explosion *e, uint16 animationMapID)
176{
177 uint16 packed;
178
179 packed = Tile_PackTile(e->position);
180
181 if (Structure_Get_ByPackedTile(packed) != NULL) return;
182
183 animationMapID += Tools_Random_256() & 0x1;
184 animationMapID += g_table_landscapeInfo[Map_GetLandscapeType(packed)].isSand ? 0 : 2;
185
186 assert(animationMapID < 16);
187 Animation_Start(g_table_animation_map[animationMapID], e->position, 0, e->houseID, 3);
188}
189
190/**
191 * Set position at the left of a row.

Callers 1

Explosion_TickFunction · 0.85

Calls 4

Tools_Random_256Function · 0.85
Map_GetLandscapeTypeFunction · 0.85
Animation_StartFunction · 0.85

Tested by

no test coverage detected