Re: [AD] Miscelaneous issues

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


Elias Pschernig wrote:

On Wed, 2005-03-30 at 14:12 +0200, Elias Pschernig wrote:
Guess that means you're next in line? ;)
Well.. :) Hm, maybe in future, we should keep a list of "jobs" on
allegro.cc, simple things like this which can be done by everyone in an
hour or two.


Ok, attached are some quick docs. For the expackf to work, I'm missing
the file "expackf.inc"..


That's a text file that looks like this:

   unsigned char pcx_block[] = "...";
   unsigned char tga_block[] = "...";

where the string are octal codes generated with this little hack:

/* begin */
#include <stdio.h>

int main(void)
{
   int c;
   while ((c = getc(stdin)) != EOF) {
       printf("\\%03o", c);
   }
   return 0;
}
/* end */

Hope that helps.

------------------------------------------------------------------------

Index: docs/src/allegro._tx
===================================================================
RCS file: /cvsroot/alleg/allegro/docs/src/allegro._tx,v
retrieving revision 1.310
diff -u -p -r1.310 allegro._tx
--- docs/src/allegro._tx	29 Mar 2005 22:02:58 -0000	1.310
+++ docs/src/allegro._tx	30 Mar 2005 17:58:41 -0000
@@ -830,15 +830,41 @@ available in past/future versions of All
@xref File and compression routines, pack_fopen, pack_fopen_chunk
@shortdesc Packfile structure, similar to a stdio.h FILE structure.
<codeblock>
-   int hndl;                   - System file handle
-   int flags;                  - PACKFILE_FLAG_* constants
-   char *filename;             - name of the file
+   AL_CONST PACKFILE_VTABLE *vtable;  - The PACKFILE_VTABLE for this packfile.
+   void *userdata;                    - The user data.
+   int is_normal_packfile;            - Flag telling if this is a normal Allegro
+                                        packfile.
<endblock>
   A packfile structure, similar to a stdio.h FILE structure. Read chapter
   "File and compression routines" for a description on how to obtain/use
   this structure.

Don't have time to check, but should we really be exposing this kind of thing in the documentation?


- +@@typedef struct @PACKFILE_VTABLE
+@xref File and compression routines, pack_fopen_vtable
+@shortdesc Packfile vtable structure, for custom packfiles.
+<codeblock>
+   int pf_fclose(void *userdata);
+   int pf_getc(void *userdata);
+   int pf_ungetc(int c, void *userdata);
+   long pf_fread(void *p, long n, void *userdata);
+   int pf_putc(int c, void *userdata);
+   long pf_fwrite(AL_CONST void *p, long n, void *userdata);
+   int pf_fseek(void *userdata, int offset);
+   int pf_feof(void *userdata);
+   int pf_ferror(void *userdata);
+<endblock>
+   This is the vtable which must be provided for custom packfiles, which then
+   can read from and write to wherever you like.
+
+


Ah, you skimped out :-) In a later version we ought to have detailed descriptions of the intended semantics of each of the vtable methods (more detailed than what we have currently for the pack_* functions).

[snip]

+@@BITMAP *@load_wav_pf(PACKFILE *f);
+@xref load_wav
+@shortdesc Packfile version of load_wav.
+   A version of load_wav which reads from a packfile.
+

It may be important to state which of the load_*_pf variants need pack_feof() to know when to stop reading. IIRC load_wav_pf is one. On the other hand, if you just concatenate all your files without imposing a chunk structure and expect the loaders to stop at the right places, you're asking for trouble.

Thanks for doing the leg-work.

Peter




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