Ignore:
Timestamp:
Apr 28, 2011, 1:56:23 AM (11 years ago)
Author:
Sam Hocevar
Message:

imlib: implement spec_directory::FullyLoad? to force loading all
assets into memory.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/imlib/specs.h

    r540 r546  
    158158class spec_entry
    159159{
     160public:
     161    spec_entry(uint8_t spec_type, char const *object_name,
     162               char const *link_filename,
     163               unsigned long data_size, unsigned long data_offset);
     164    ~spec_entry();
     165
     166    void Print();
     167
     168    char *name;
     169    void *data;
     170    unsigned long size, offset;
     171    uint8_t type;
     172};
     173
     174
     175class spec_directory
     176{
    160177public :
    161   char *name;
    162   unsigned long size,offset;
    163   unsigned char type;
    164 
    165   spec_entry(unsigned char spec_type,
    166              char const *object_name,
    167              char const *link_filename,
    168              unsigned long data_size,
    169              unsigned long data_offset)
    170   { type = spec_type;
    171     name = strdup(object_name);
    172     size = data_size;
    173     offset = data_offset;
    174   }
    175   void print();
    176   ~spec_entry() { if (name) free(name); }
    177 } ;
    178 
    179 
    180 class spec_directory
    181 {
    182 public :
    183   void startup(bFILE *fp);
    184 
    185   int total;
    186   spec_entry **entries;
    187   void *data;
    188   long size;
     178    spec_directory(FILE *fp);
     179    spec_directory(bFILE *fp);
     180    spec_directory();
     181    ~spec_directory();
     182
     183    void startup(bFILE *fp);
     184    void FullyLoad(bFILE *fp);
     185
    189186//  spec_directory(char *filename);  ; ; not allowed anymore, user must construct file first!
    190   spec_directory(FILE *fp);
    191   spec_directory(bFILE *fp);
    192   spec_directory();
    193187  spec_entry *find(char const *name);
    194188  spec_entry *find(char const *name, int type);
     
    206200  void print();
    207201  void delete_entries();   // if the directory was created by hand instead of by file
    208   ~spec_directory();
    209 } ;
     202
     203    int total;
     204    spec_entry **entries;
     205    void *data;
     206    size_t size;
     207};
    210208
    211209/*jFILE *add_directory_entry(char *filename,
Note: See TracChangeset for help on using the changeset viewer.