MCPcopy Create free account
hub / github.com/Meridian59/Meridian59 / ExtractAnimation

Function ExtractAnimation

clientd3d/server.c:222–261  ·  view source on GitHub ↗

/ * ExtractAnimation: Get an animation structure from ptr, and increment * ptr appropriately. Place data in given animation structure. */

Source from the content-addressed store, hash-verified

220 * ptr appropriately. Place data in given animation structure.
221 */
222void ExtractAnimation(char **ptr, Animate *a)
223{
224 Extract(ptr, &a->animation, SIZE_ANIMATE);
225
226 // Read animation-type dependent stuff
227 switch(a->animation)
228 {
229 case ANIMATE_NONE:
230 Extract(ptr, &a->group, SIZE_ANIMATE_GROUP);
231 a->group = BitmapGroupSToC(a->group);
232 break;
233
234 case ANIMATE_CYCLE:
235 Extract(ptr, &a->period, 4);
236 Extract(ptr, &a->group_low, SIZE_ANIMATE_GROUP);
237 Extract(ptr, &a->group_high, SIZE_ANIMATE_GROUP);
238 a->group_low = BitmapGroupSToC(a->group_low);
239 a->group_high = BitmapGroupSToC(a->group_high);
240 a->group = a->group_low;
241 a->tick = a->period;
242 break;
243
244 case ANIMATE_ONCE:
245 Extract(ptr, &a->period, 4);
246 Extract(ptr, &a->group_low, SIZE_ANIMATE_GROUP);
247 Extract(ptr, &a->group_high, SIZE_ANIMATE_GROUP);
248 Extract(ptr, &a->group_final, SIZE_ANIMATE_GROUP);
249 a->group_low = BitmapGroupSToC(a->group_low);
250 a->group_high = BitmapGroupSToC(a->group_high);
251 a->group_final = BitmapGroupSToC(a->group_final);
252 a->group = a->group_low;
253 a->tick = a->period;
254 break;
255
256 default:
257 debug(("Unknown animation type %d read from server\n", a->animation));
258 a->group = 0;
259 break;
260 }
261}
262/********************************************************************/
263/*
264 * ExtractOverlays: Get overlay structures from ptr,

Callers 8

ExtractOverlayFunction · 0.85
ExtractObjectFunction · 0.85
ExtractNewRoomObjectFunction · 0.85
HandleChangeFunction · 0.85
HandleShootFunction · 0.85
HandleWallAnimateFunction · 0.85
HandleSectorAnimateFunction · 0.85

Calls 1

ExtractFunction · 0.85

Tested by

no test coverage detected