Mercurial > hg > dmlib
comparison src/dmres.h @ 1040:ebabf5aefb76
Work on resource handling.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 01 Mar 2015 17:17:36 +0200 |
parents | 1a0a327d8fed |
children | b6c5e0c62588 |
comparison
equal
deleted
inserted
replaced
1039:54970cd5acf0 | 1040:ebabf5aefb76 |
---|---|
42 DRF_PRELOAD_RES = 0x0008, | 42 DRF_PRELOAD_RES = 0x0008, |
43 }; | 43 }; |
44 | 44 |
45 enum | 45 enum |
46 { | 46 { |
47 DMF_PERSIST = 0x00001, // Persist loaded RAW resource | 47 DMF_PERSIST = 0x0001, // Persist loaded RAW resource |
48 DMF_TEMPORARY = 0x00002, | 48 DMF_COMPRESSED = 0x0002, // Resource is compressed in PACK file, otherwise raw |
49 DMF_UNALLOCATED = 0x00004, // The raw data is not allocated, so do not free it | 49 DMF_TEMPORARY = 0x0004, |
50 DMF_LOADED_RAW = 0x01000, // Raw data has been loaded | 50 DMF_PACK_MASK = 0x00ff, // Mask for flags that may be specified in PACK |
51 DMF_LOADED_RES = 0x02000, // Resource has been loaded | 51 |
52 DMF_COMPRESSED = 0x10000, // Resource is compressed in PACK file, otherwise raw | 52 DMF_UNALLOCATED = 0x1000, // The raw data is not allocated, so do not free it |
53 DMF_LOADED_RAW = 0x2000, // Raw data has been loaded | |
54 DMF_LOADED_RES = 0x4000, // Resource has been loaded | |
53 }; | 55 }; |
54 | 56 |
55 | 57 |
56 /* Typedefs and structures | 58 /* Typedefs and structures |
57 */ | 59 */ |
142 int dmResourcesClose(DMResourceLib *lib); | 144 int dmResourcesClose(DMResourceLib *lib); |
143 | 145 |
144 void dmResourcesPrune(DMResourceLib *lib, const int agems, int const flags); | 146 void dmResourcesPrune(DMResourceLib *lib, const int agems, int const flags); |
145 int dmResourcesPreload(DMResourceLib *lib, BOOL start, int *loaded, int *total); | 147 int dmResourcesPreload(DMResourceLib *lib, BOOL start, int *loaded, int *total); |
146 | 148 |
147 DMResource * dmResourceNew(DMResourceLib *lib, const char *filename, const size_t size); | 149 DMResource * dmResourceNew(DMResourceLib *lib, const char *filename, const size_t size, const int flags); |
148 void dmResourceFree(DMResource *node); | 150 void dmResourceFree(DMResource *node); |
149 void dmResourceInsert(DMResourceLib *lib, DMResource * node); | 151 void dmResourceInsert(DMResourceLib *lib, DMResource * node); |
150 void dmResourceDelete(DMResourceLib *lib, DMResource * node); | 152 void dmResourceDelete(DMResourceLib *lib, DMResource * node); |
151 DMResource * dmResourceFind(DMResourceLib *lib, const char *filename); | 153 DMResource * dmResourceFind(DMResourceLib *lib, const char *filename); |
152 int dmResourceRef(DMResource *); | 154 int dmResourceRef(DMResource *); |