00001 #ifndef SFF_LOADER
00002 #define SFF_LOADER
00003
00004 #include <allegro.h>
00010 typedef struct {
00011 char magic[12];
00012 char version[4];
00013 int countGroups;
00014 int countImages;
00015 int offsetFirstSubFile;
00016 int sizeOfSubfileHeader;
00017 char palType;
00018 char padding[3];
00019 char comment[476];
00020 } SFFHeader;
00021
00022 typedef struct {
00023 int nextSubFile;
00024 int sizeOfData;
00025 short x;
00026 short y;
00027 short group;
00028 short curIndex;
00029 short prevIndex;
00030 char reusePalette;
00031 char comment[13];
00032 char pcxData[1];
00033 } SFFSubFileHeader;
00034
00035 typedef struct SFFEntryStruct {
00036 short x, y, group, curIndex, prevIndex;
00037 char isLinkedImage;
00038 RGB* pal;
00039 BITMAP* image;
00040 char comment[13];
00041
00042 struct SFFEntryStruct *next;
00043 } SFFEntry;
00044
00045 typedef struct {
00046 FONT* font;
00047 RGB* pal;
00048 int colors;
00049 } FNTInfo;
00050
00051 typedef struct {
00052 SAMPLE **sounds;
00053 int maxGroupIndex;
00054 int maxSoundIndex;
00055 } SNDCollection;
00056
00057
00058 #define SFF_LOAD_RET_TYPE SFFEntry*
00059
00060 SFF_LOAD_RET_TYPE sffLoad(const char* filename);
00061 SFF_LOAD_RET_TYPE sffLoadFromMemory(void *memory);
00062 FNTInfo* fntLoadFont(const char* filename);
00063 PALETTE* fntGetPaletteForBank(FNTInfo* info, int bank);
00064
00065 SNDCollection* sndLoadSound(const char* filename);
00066 int sndPlay(SNDCollection* snd, int group, int sound, int volume, int pan);
00067 void sndStop(SNDCollection* snd, int group, int sound);
00068 SNDCollection* sndFreeSound(SNDCollection* snd);
00069
00070 RGB* load_act_pal(const char* filename);
00071 #endif
00072