Re: [AD] file slices

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 2011-07-29, Matthew Leverton <meffer@xxxxxxxxxx> wrote:
> On Tue, Jul 19, 2011 at 7:09 PM, Peter Wang <novalazy@xxxxxxxxxx> wrote:
> > That still sounds complicated.  I prefer your previous suggestion
> > to remove any buffering from file slices.  Then file slices are
> > analogous to sub-bitmaps, and memfiles are analogous to memory bitmaps.
> >
> Attached is an implementation of unbuffered file slices. To run the
> included test, you need to make test.tga that contains texture.tga
> twice:
> 
> cat texture.tga texture.tga > test.tga
> 
> When using slices both can be loaded successfully, but without them
> the second try fails. (I think the TGA loader doesn't seek to the end
> of file when done.)
> 
> It would introduce one function:
> 
> ALLEGRO_FILE *al_fopen_slice(ALLEGRO_FILE *fp, size_t initial_size,
> const char *mode);

Looks good to me.

Do we need to allow the user to set userdata on a slice?
That probably requires adding an extra field to ALLEGRO_FILE.

Peter




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/