LoadAnim

Loads an animation

Synopsis

ANIM * LoadAnim (char *fileName, uint32 memTypeBits)

Description

Loads an animation file from disk. Parses the cels within the animation into an ANIM structure and returns a pointer to the ANIM.

The animation file can be single-CCB or multi-CCB format. An optional ANIM chunk may appear at the start of the file. The file can contain pixel and color chunks in either PDAT, PLUT or PLUT, PDAT order, but the chunks must appear in the same order throughout the file. (3DO Animator creates PLUT, PDAT files; PDAT, PLUT files result from concatenating cel files using MPW.)

When you are finished with the animation, use UnloadAnim() to free all resources acquired by LoadAnim() for a given animation file.

The frames within an animation are allocated incrementally. Initially a block large enough to hold N_FRAMES_PER_CHUNK frames is allocated. If this is exceeded while reading the ANIM then a block with space for N_FRAMES_PER_CHUNK additional frames is allocated, the previously computed frames are copied into this new space, and the old full buffer space is deallocated

The tag_AnimFrame and tag_ANIM structures, defined in animutils.h, are used by LoadAnim().

The frames within an ANIM are allocated incrementally. Initially a block large enough to hold N_FRAMES_PER_CHUNK frames is allocated. If this is exceeded while reading the ANIM then a block with space for N_FRAMES_PER_CHUNK additional AnimFrames is allocated, the previously computed frames are copied into this new space, and the old full AnimFrame buffer space is deallocated

Arguments

fileName
Pointer to the file name string.
memTypeBits
Type of memory to use when loading the file; usually MEMTYPE_ANY.

Return Value

Pointer to an ANIM structure, or NULL if an error occurred.

Associated Files

lib3do.lib, animutils.h

See Also

UnloadAnim, GetAnimCel, DrawAnimCel