[AD] loading pcx from memory

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



> > I'm currently work in on a game around allegro and I needed a way of
> > loading pcx images directly from the memory rathen than a file as in
> > load_pcx().
> 
> 
> Is it because your game generates the file? Otherwise, I don't see any 
> advantage of using this.

No, but we decided to go with our own animation file format, where the
animation frames are stored as a pcx file inside the animation file.
Otherwise loading pcx from memory can be usefull for example while reciving
it over a network.

> Plus, you made the original load_pcx() use 2x 
> the memory!
> 
Yes, roughly, on the other side I belive that it is faster because the hole
file is loaded at once. Othervice it is to just to stick to the old
load_pcx(), the load_mem_pcx() won't be affected by it.

 The reason why I changed load_pcx() was that i dislike duplicant code.
load_pcx() and load_mem_pcx() was basicly same rutine, which made library a
little bigger than needed. Another reson why I don't like duplicant code is
the montainance problem. If you would like to update it it is very easy to
forget to update one of the copies. 

Anyway this is mostly a personal taste matters, whatever you prefore memory
efficient or smaller code.

/Elmir J



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