agssim: improve error reporting
[rofl0r-agsutils.git] / SpriteFile.h
blobbf73d703014da5fb311b83be7a020c8998e71463
1 #ifndef SPRITEFILE_H
2 #define SPRITEFILE_H
4 #include <stdio.h>
5 #include "File.h"
6 #include "ImageData.h"
8 typedef struct SpriteFile {
9 short version;
10 unsigned short num_sprites;
11 int compressed;
12 int id;
14 unsigned *offsets;
15 unsigned char *palette;
17 /* private stuff */
18 unsigned sc_off;
20 } SpriteFile;
22 /* read interface */
24 /* read TOC */
25 int SpriteFile_read(AF* f, SpriteFile *sf);
26 /* returns uncompressed sprite in data */
27 int SpriteFile_extract(AF* f, SpriteFile *sf, int spriteno, ImageData *data);
30 /* write interface */
31 int SpriteFile_write_header(FILE *f, SpriteFile *sf);
32 int SpriteFile_add(FILE *f, SpriteFile *sf, ImageData *data);
33 int SpriteFile_finalize(FILE* f, SpriteFile *sf);
35 /* sprindex.dat */
36 int SpriteFile_write_sprindex(AF* f, SpriteFile *sf, FILE *outf);
38 #pragma RcB2 DEP "SpriteFile.c"
40 #endif