ptr_first (void* object);
Returns a pointer to the first object for a given engine object.
Parameters:
object - ENTITY*, STRING*, BMAP*, VIEW*, PANEL*, TEXT*, FONT*,
SOUND*, or MATERIAL* pointer.
Returns:
First object of the same type.
Speed:
Fast
Remarks:
- Engine objects are stored in linked lists, chained by the next pointer
of the C_LINK struct (see include\atypes.h). Therefore
this instruction can be used
in lite-C or in external languages
to find all objects of a given type.
- The type of an object can be determined by its handle, returned
by the handle instruction.
Example:
BMAP* pBmap;
BMAP* bmTest = "test.tga";
...
// walk through all bitmaps
pBmap = ptr_first(bmTest);
while (pBmap)
{
do_something_with(pBmap);
pBmap = pBmap.link.next;
}
See also:
ptr_for_handle,
handle, ptr_remove
► latest
version online