Name
RegisterAnimSaver -- register a new animation saver (V5.0)
Synopsis
void RegisterAnimSaver(struct SaveAnimReg *reg)
Function
Hollywood will call this function to get information about the animation saver your plugin wants to register. In addition, RegisterAnimSaver() has to tell Hollywood whether it wants to register another animation saver. Hollywood will pass a pointer to a struct SaveAnimReg to this function. This structure looks like this:

 
struct SaveFormatReg
{
    ULONG CapsMask;     [out]
    ULONG FormatID;     [in/out]
    STRPTR FormatName;  [out]
};

struct SaveAnimReg
{
    struct SaveFormatReg hdr;
};

Your implementation has to do the following with the individual structure members:

CapsMask:
This must be set to a combination of flags that tell Hollywood about the capabilities of the animation saver that is to be registered. The following flags are currently supported:

HWSAVEANMCAPS_ARGB:
Your animation saver supports source animation data that is delivered as a 32-bit ARGB pixel array.

HWSAVEANMCAPS_CLUT:
Your animation saver supports source animation data that is delivered as 8-bit CLUT pixels that are index values for a palette look-up table.

HWSAVEANMCAPS_ALPHA:
Your animation saver supports alpha channel saving. This is only supported if you also set HWSAVEANMCAPS_ARGB.

HWSAVEANMCAPS_MORE:
If you set this flag, Hollywood will call RegisterAnimSaver() again so that you can register another saver. If you don't want to register another saver, don't set this flag. (V5.3)

Note that HWSAVEANMCAPS_ARGB and HWSAVEANMCAPS_CLUT are not mutually exclusive. You can set them both if the target animation format supports both true colour and palette-based pixel data storage.

FormatID:
This member must be set to a unique 32-bit value that should be assigned to the constant that is registered for accessing this animation saver from Hollywood scripts. Values smaller than 32768 are reserved for internal Hollywood use. You may use values larger than 32768 for your saver but if you want to publish your plugin, you need to contact Airsoft Softwair to obtain a unique value that is still vacant. This won't cost you anything; it's just needed to make sure that plugin animation savers don't use conflicting identifiers. Also, once you have published your animation saver plugin, the FormatID you have specified must not be changed or you will break compatibility with applets or executables that have been compiled with previous versions. If you are registering more than one animation saver using HWSAVEANMCAPS_MORE, you can look at the FormatID member to tell how many times Hollywood has already called RegisterAnimSaver() because FormatID will contain the identifier of the last animation saver you registered. If FormatID is 0, then this is the first call to RegisterAnimSaver(). Note that it is not recommended to keep your own counter because Hollywood might call RegisterAnimSaver() multiple times, i.e. it might first loop over RegisterAnimSaver() to determine how many animation savers there are in total and then it might loop over RegisterAnimSaver() again to actually register their names.

FormatName:
This must be set to a string that should form the second half of the constant that Hollywood registers for your animation saver. This string you specify here must follow the naming restrictions for Hollywood constants, i.e. only alphabetical characters, numbers and very few special characters like the underscore character are allowed. The #ANMFMT_ prefix must not be included in the string you pass. Hollywood will add this automatically, i.e. if you pass the string "TESTFORMAT" here, Hollywood will make your animation saver available under the constant #ANMFMT_TESTFORMAT.

Inputs
reg
pointer to a struct SaveAnimReg to be filled out by your implementation

Show TOC