Mercurial > hg > dmlib
view dmpack.h @ 49:033c660c25f5
Restructure module playing, removing 8bit sample mixing (output can still be
8bit, but samples are internally upconverted to 16bit after module loading.)
Also prepare for floating point mixing support.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 01 Oct 2012 02:51:41 +0300 |
parents | 32250b436bca |
children | bb14d7907eb2 |
line wrap: on
line source
/* * DMLib * -- PACK-file routines * Programmed and designed by Matti 'ccr' Hamalainen * (C) Copyright 2011 Tecnic Software productions (TNSP) */ #ifndef DMPACK_H #define DMPACK_H #include "dmlib.h" #define DPACK_IDENT "TNSPDPCK" // Magic ident #define DPACK_VERSION (0x0120) // Version #define DPACK_TMPSIZE (128 * 1024) typedef struct _DMPackEntry { char filename[DMRES_NAME_LEN]; Uint32 size; // Size (UNCOMPRESSED) Uint32 offset; // Offset in pack file Uint32 length; // (Compressed) data length Uint32 resFlags; // Resource flags (used by resource handler) Uint32 privFlags; // Private flags struct _DMPackEntry *next, *prev; } DMPackEntry; typedef struct { DMPackEntry *entries; char * filename; // Filename & path FILE * file; // File } DMPackFile; typedef struct { char ident[8]; // Magic identifier Uint16 version; // Version Uint32 dirEntries; // Number of entries Uint32 dirOffset; // Offset of the directory } DMPackFileHeader; DMPackEntry * dm_pack_entry_new(); void dm_pack_entry_free(DMPackEntry *); void dm_pack_entry_insert(DMPackEntry **, DMPackEntry *); void dm_pack_entry_delete(DMPackEntry **, DMPackEntry *); DMPackEntry * dm_pack_find(DMPackEntry *list, const char *filename); int dm_pack_open(const char *, DMPackFile **, BOOL); int dm_pack_close(DMPackFile *); int dm_pack_read(DMPackFile *, const char *, Uint8 **, size_t *); #endif // DMPACK_H