diff options
Diffstat (limited to 'apps/codecs/dumb/src/allegro/dats3m.c')
-rw-r--r-- | apps/codecs/dumb/src/allegro/dats3m.c | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/apps/codecs/dumb/src/allegro/dats3m.c b/apps/codecs/dumb/src/allegro/dats3m.c new file mode 100644 index 0000000000..a0fc74420e --- /dev/null +++ b/apps/codecs/dumb/src/allegro/dats3m.c | |||
@@ -0,0 +1,61 @@ | |||
1 | /* _______ ____ __ ___ ___ | ||
2 | * \ _ \ \ / \ / \ \ / / ' ' ' | ||
3 | * | | \ \ | | || | \/ | . . | ||
4 | * | | | | | | || ||\ /| | | ||
5 | * | | | | | | || || \/ | | ' ' ' | ||
6 | * | | | | | | || || | | . . | ||
7 | * | |_/ / \ \__// || | | | ||
8 | * /_______/ynamic \____/niversal /__\ /____\usic /| . . ibliotheque | ||
9 | * / \ | ||
10 | * / . \ | ||
11 | * dats3m.c - Integration of S3M files with / / \ \ | ||
12 | * Allegro's datafiles. | < / \_ | ||
13 | * | \/ /\ / | ||
14 | * By entheh. \_ / > / | ||
15 | * | \ / / | ||
16 | * | ' / | ||
17 | * \__/ | ||
18 | */ | ||
19 | |||
20 | #include <allegro.h> | ||
21 | |||
22 | #include "aldumb.h" | ||
23 | #include "internal/aldumb.h" | ||
24 | |||
25 | |||
26 | |||
27 | static void *dat_read_s3m(PACKFILE *f, long size) | ||
28 | { | ||
29 | DUMBFILE *df; | ||
30 | DUH *duh; | ||
31 | |||
32 | (void)size; | ||
33 | |||
34 | df = dumbfile_open_packfile(f); | ||
35 | |||
36 | if (!df) | ||
37 | return NULL; | ||
38 | |||
39 | duh = dumb_read_s3m(df); | ||
40 | |||
41 | dumbfile_close(df); | ||
42 | |||
43 | return duh; | ||
44 | } | ||
45 | |||
46 | |||
47 | |||
48 | /* dumb_register_dat_s3m(): tells Allegro about the S3M datafile object. If | ||
49 | * you intend to load a datafile containing an S3M object, you must call this | ||
50 | * function first. It is recommended you pass DUMB_DAT_S3M, but you may have | ||
51 | * a reason to use a different type (perhaps you already have a datafile with | ||
52 | * S3M files in and they use a different type). | ||
53 | */ | ||
54 | void dumb_register_dat_s3m(long type) | ||
55 | { | ||
56 | register_datafile_object( | ||
57 | type, | ||
58 | &dat_read_s3m, | ||
59 | &_dat_unload_duh | ||
60 | ); | ||
61 | } | ||