Subversion Repositories ipe_artfile_utils

Rev

Blame | Last modification | View Log | RSS feed

  1. /**
  2.  * ART files for Imagination Pilots Entertainment 32-bit games (IPE32)
  3.  * - Where's Waldo? Exploring Geography
  4.  * - Eraser Turnabout by Imagination Pilots
  5.  * - Virtual K'Nex by Imagination Pilots
  6.  * ART file packer and unpacker by Daniel Marschall, ViaThinkSoft (C) 2018
  7.  * Revision: 2018-02-15
  8.  **/
  9.  
  10. #ifndef __inc__ipe32_artfile
  11. #define __inc__ipe32_artfile
  12.  
  13. #include <stdint.h>
  14.  
  15. #define IPE32_COMPRESSIONTYPE_LZW 0
  16. #define IPE32_COMPRESSIONTYPE_NONE 1
  17.  
  18. #define IPE32_NAME_SIZE 8
  19.  
  20. #define IPE32_MAGIC_ART "ART_DATA"
  21.  
  22. #pragma pack(push, 1)
  23.  
  24. typedef struct tagIpe32FileHeader {
  25.         char       magic[IPE32_NAME_SIZE];   // always "ART_DATA"
  26.         uint32_t   totalHeaderSize;          // size of all headers (file header and all picture headers). headerSize/16 = numberPictures
  27.         uint32_t   reserved;                 // always 0
  28. } Ipe32FileHeader;
  29.  
  30. typedef struct tagIpe32PictureEntryHeader {
  31.         char       name[IPE32_NAME_SIZE];
  32.         uint32_t   offset;                  // offset to the picture (Ipe32PictureHeader)
  33.         uint32_t   uncompressedSize;        // size of the picture (picture data + palette)
  34. } Ipe32PictureEntryHeader;
  35.  
  36. /*
  37. typedef struct tagIpe32PictureChunk {
  38.         unsigned compressionType : 1;   // Compression type of the follow-up data
  39.                                         // 0 = LZW-like compression (special implementation)
  40.                                         // 1 = None
  41.         unsigned chunkDataSize : 15;    // size of the chunk data
  42.         //char         data[];
  43. } Ipe32PictureChunk;
  44. */
  45.  
  46. #pragma pack(pop)
  47.  
  48. #endif // #ifndef __inc__ipe32_artfile
  49.  
  50.