====== zformat_CreateGeneric ====== ===== Description ===== Create an instance of a file format handler for a particular [[zeolite:mapID|map type]]. This function, or [[zeolite:functions:zformat_Create]], must be called at least once by a file input/output plugin to register a file format before it can be used to save or load map files. ===== Files ===== ^ Declaration | ''Zeolite.h'' | ^ Implementation | ''Zeolite.cpp'' | ===== Function prototype ===== ZFORMAT zformat_CreateGeneric(long MapTypeID, const char* lpLongName, const char* lpFileExt, const char* lpNativeProgramName); ===== Arguments ===== ^ Name ^ Type ^ Comment ^ | //MapTypeID// | ''long'' | An integer containing the [[zeolite:mapID|map type identifier]] that can be saved/loaded by this format. | | //lpLongName// | ''const char*'' | A pointer to a C-style string, containing the full display name of the format (e.g. "L3DT Design map File"). | | //lpFileExt// | ''const char*'' | A pointer to a C-style string, containing the file extension (e.g. "dmf"). | | //lpFileExt// | ''const char*'' | A pointer to a C-style string, containing the name of the program to which this format is considered native (e.g. "L3DT"). | ===== Return value ===== Null if an error occurred or the format already existed, and otherwise a valid [[zeolite:types:ZFORMAT]] handle. ===== Comments ===== ==== Comparison with zformat_Create ==== The difference between this function and [[zeolite:functions:zformat_Create]] is perhaps best explained by examples of the usage of the ZFORMATs created by these functions: * When saving some generic colour map, such as a screen capture, L3DT will use the ZFORMAT created by ''zformat_CreateGeneric'' for the ''MAP_RGB'' type. * When saving the map project's light map and texture map, L3DT will use the ZFORMAT created for those maps using ''zformat_Create''. Even though the texture and light maps are actually of type ''MAP_RGB'', they have their own format settings (created by ''zformat_Create'') so that the user can set specific formation options for them. ==== Alpha map formats ==== The [[l3dt:userguide:ops:alpha|Alpha map export]] from L3DT uses the lists of formats created for the ''MAP_BYTE'', ''MAP_RGB'', and ''MAP_RGBA'' types. ''MAP_BYTE'' is used for one layer/image, ''MAP_RGB'' for three, and ''MAP_RGBA'' for four.