summaryrefslogtreecommitdiff
path: root/apps/codecs/dumb/src/allegro/datduh.c
diff options
context:
space:
mode:
authorMichiel Van Der Kolk <not.valid@email.address>2005-03-17 20:50:03 +0000
committerMichiel Van Der Kolk <not.valid@email.address>2005-03-17 20:50:03 +0000
commit27be5bc72855a0fbbdae230bc144624c9eb85f5e (patch)
treeb553f1321df924c4b744ffcab48dce5f4f081f7d /apps/codecs/dumb/src/allegro/datduh.c
parent7e7662bb716917ca431204f0113d400c1014f2e8 (diff)
downloadrockbox-27be5bc72855a0fbbdae230bc144624c9eb85f5e.tar.gz
rockbox-27be5bc72855a0fbbdae230bc144624c9eb85f5e.zip
Initial check in dumb 0.9.2 - has a few usages of floating point that should
be rewritten to fixed point. seems to compile cleanly for iriver. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6197 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/dumb/src/allegro/datduh.c')
-rw-r--r--apps/codecs/dumb/src/allegro/datduh.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/apps/codecs/dumb/src/allegro/datduh.c b/apps/codecs/dumb/src/allegro/datduh.c
new file mode 100644
index 0000000000..672e3c820c
--- /dev/null
+++ b/apps/codecs/dumb/src/allegro/datduh.c
@@ -0,0 +1,60 @@
1/* _______ ____ __ ___ ___
2 * \ _ \ \ / \ / \ \ / / ' ' '
3 * | | \ \ | | || | \/ | . .
4 * | | | | | | || ||\ /| |
5 * | | | | | | || || \/ | | ' ' '
6 * | | | | | | || || | | . .
7 * | |_/ / \ \__// || | |
8 * /_______/ynamic \____/niversal /__\ /____\usic /| . . ibliotheque
9 * / \
10 * / . \
11 * datduh.c - Integration with Allegro's / / \ \
12 * 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
27static void *dat_read_duh(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 = read_duh(df);
40
41 dumbfile_close(df);
42
43 return duh;
44}
45
46
47
48/* dumb_register_dat_duh(): tells Allegro about the DUH datafile object. If
49 * you intend to load a datafile containing a DUH object, you must call this
50 * function first. It is recommended you pass DAT_DUH, but you may have a
51 * reason to use a different type (apart from pride, that doesn't count).
52 */
53void dumb_register_dat_duh(long type)
54{
55 register_datafile_object(
56 type,
57 &dat_read_duh,
58 &_dat_unload_duh
59 );
60}