Mail Archives: djgpp/1997/10/16/16:31:22
Matthew Bloch writes:
>Well... the thing that has confused me about the DAT files is that you
>have a separate call in the API for pulling out BMPs, WAVs etc.,
What do you mean? There is the load_datafile() function for reading
entire files, and there is load_datafile_object() for loading an
individual object. Those don't look like separate calls to me!
>but they're all essentially *data*.
Yeah, but the data means totally different things, and is held in
different formats once it is in memory (look in allegro.h, and you wlil
see that things like the BITMAP structure aren't just a binary block of
memory). Plus sometimes there are things that need to be converted
during the load process (compiled sprites from pixel data to machine
code, or truecolor pixels from RGB format to whatever layout the video
card is using), so the loader has to know what type of data it is
reading. The API does give you a standard function for loading any type
of object, that returns a pointer to the data in the "dat" field, but
how the code works, and what structure this void pointer refers to,
obviously needs to be different from one object type to another...
--
Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
Beauty is a French phonetic corruption of a short cloth neck ornament.
- Raw text -