GEMLIB
0.44.0
|
resource files More...
Macros | |
#define | rsrc_free() mt_rsrc_free(aes_global) |
#define | rsrc_gaddr(a, b, c) mt_rsrc_gaddr(a,b,c,aes_global) |
#define | rsrc_load(a) mt_rsrc_load(a,aes_global) |
#define | rsrc_obfix(a, b) mt_rsrc_obfix(a,b,aes_global) |
#define | rsrc_rcfix(a) mt_rsrc_rcfix(a,aes_global) |
#define | rsrc_saddr(a, b, c) mt_rsrc_saddr(a,b,c,aes_global) |
Functions | |
short | mt_rsrc_free (short *global_aes) |
short | mt_rsrc_gaddr (short Type, short Index, void *Address, short *global_aes) |
short | mt_rsrc_load (const char *Name, short *global_aes) |
short | mt_rsrc_obfix (OBJECT *, short Index, short *global_aes) |
short | mt_rsrc_rcfix (void *rc_header, short *global_aes) |
short | mt_rsrc_saddr (short Type, short Index, void *Address, short *global_aes) |
resource files
The Resource Library is responsibe for the loading/unloading of resource files and the manipulation of resource objects in memory.
#define rsrc_free | ( | ) | mt_rsrc_free(aes_global) |
single-thread version of mt_rsrc_free()
#define rsrc_gaddr | ( | a, | |
b, | |||
c | |||
) | mt_rsrc_gaddr(a,b,c,aes_global) |
single-thread version of mt_rsrc_gaddr()
#define rsrc_load | ( | a | ) | mt_rsrc_load(a,aes_global) |
single-thread version of mt_rsrc_load()
#define rsrc_obfix | ( | a, | |
b | |||
) | mt_rsrc_obfix(a,b,aes_global) |
single-thread version of mt_rsrc_obfix()
#define rsrc_rcfix | ( | a | ) | mt_rsrc_rcfix(a,aes_global) |
single-thread version of mt_rsrc_rcfix()
#define rsrc_saddr | ( | a, | |
b, | |||
c | |||
) | mt_rsrc_saddr(a,b,c,aes_global) |
single-thread version of mt_rsrc_saddr()
short mt_rsrc_free | ( | short * | global_aes | ) |
releases memory allocated by mt_rsrc_load() for an application's resource.
global_aes | global AES array |
mt_rsrc_free() should be called before an application which loaded a resource using mt_rsrc_load() exits.
short mt_rsrc_gaddr | ( | short | Type, |
short | Index, | ||
void * | Address, | ||
short * | global_aes | ||
) |
returns the address of an object loaded with mt_rsrc_load().
Type | see below |
Index | see below |
Address | The pointer pointed to by Address will be filled in with the address of the Index -th resource object of type Type. Valid values for Type are: [option CHECK_NULLPTR] Address may be NULL |
global_aes | global AES array |
This function is most often used to obtain the address of OBJECT trees (R_TREE), 'free' strings (R_FRSTR), and 'free' images (R_FRIMG) after loading a resource file.
short mt_rsrc_load | ( | const char * | Name, |
short * | global_aes | ||
) |
loads and allocates memory for the named resource file.
Name | is a character pointer to a NULL-terminated GEMDOS file specification of the resource to load. |
global_aes | global AES array |
In addition to loading the resource, all OBJECT coordinates are converted from character based coordinates to pixels based coordinates.
short mt_rsrc_obfix | ( | OBJECT * | Tree, |
short | Index, | ||
short * | global_aes | ||
) |
converts an object's coordinates from character-based to pixel-based.
Tree | specifies the OBJECT tree containing the object... |
Index | ... to convert. |
global_aes | global AES array |
All objects in '.RSC' files have their coordinates based on character positions rather than screen coordinates to allow an object tree to be shown in any resolution. This function converts those character coordinates to pixel coordinates based on the current screen resolution.
short mt_rsrc_rcfix | ( | void * | rc_header, |
short * | global_aes | ||
) |
fixes up coordinates and memory pointers of raw resource data in memory.
rc_header | is a pointer to an Atari Resource Construction Set (or compatible) resource file header in memory. |
global_aes | global AES array |
If a resource has already been loaded with mt_rsrc_load() it must be freed by mt_rsrc_free() prior to this call. In addition, resources identified with this call must likewise be freed before program termination or another resource file is needed.
short mt_rsrc_saddr | ( | short | Type, |
short | Index, | ||
void * | Address, | ||
short * | global_aes | ||
) |
sets the address of a resource element.
Type | specifies the type of resource element to set as defined under mt_rsrc_gaddr() |
Index | specifies the index of the element to modify (0 based) |
Address | specifies the actual address that will be placed in the appropriate data structure. |
global_aes | global AES array |
Use only Type from 7 to 16 here (that is R_OBSPEC, R_TEPTEXT, R_TEPTMPLT, R_TEPVALID, R_IBPMASK, R_IBPDATA, R_IBPTEXT, R_BIPDATA, R_FRSTR or R_FRIMG ) ! Others destroy a part of the object tree.
In most cases, direct manipulation of the structures involved is quicker and easier than using this call.