IFF.H 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
  3. SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
  4. END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
  5. ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
  6. IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
  7. SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
  8. FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
  9. CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
  10. AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
  11. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
  12. */
  13. /*
  14. Constants and structures for IFF routines
  15. */
  16. #define IFF_NO_ERROR 0
  17. #define IFF_NO_MEM 1
  18. #define IFF_UNKNOWN_FORM 2
  19. #define IFF_NOT_IFF 3
  20. #define PBM_TYPE 1
  21. #define ILBM_TYPE 2
  22. #define cmpNone 0
  23. #define cmpByteRun1 1
  24. #define mskNone 0
  25. #define mskHasMask 1
  26. #define mskHasTransparentColor 2
  27. #define byte BYTE
  28. /* structures used by IFF parser */
  29. typedef unsigned char BYTE;
  30. typedef char SBYTE;
  31. typedef unsigned short WORD;
  32. typedef short SWORD;
  33. typedef unsigned int DWORD;
  34. typedef int SDWORD;
  35. struct pal_entry {BYTE r,g,b;};
  36. // w = width, must be set
  37. // h = height, must be set
  38. // x,y ignored
  39. // transparentcolor, set this to 0
  40. // pagewidth = width of source screen, set to 320
  41. // pageheight = height of source screen, set to 200
  42. // nplanes = 8
  43. // masking = set according to constants above, set to 0
  44. // compression = 0 (cmpNone)
  45. // xaspect = 5
  46. // yaspect = 6
  47. // palette = i must set this, values get shifted up by 4x
  48. // raw_data = poSWORD to my data
  49. struct bitmap_header {
  50. SWORD w,h,x,y;
  51. SWORD type;
  52. SWORD transparentcolor,pagewidth,pageheight;
  53. SBYTE nplanes,masking,compression;
  54. SBYTE xaspect,yaspect;
  55. struct pal_entry palette[256];
  56. BYTE *raw_data;
  57. };
  58. #define BM_LINEAR 0
  59. #define BM_MODEX 1
  60. #define BM_SVGA 2
  61. #define BM_RGB15 3 //5 bits each r,g,b stored at 16 bits
  62. typedef struct {
  63. WORD X, Y;
  64. WORD Width;
  65. WORD Height;
  66. WORD Type;
  67. WORD Rowsize;
  68. DWORD DataPtr;
  69. WORD Data[1];
  70. } BITMAP15;
  71. typedef struct {
  72. WORD X, Y;
  73. WORD Width;
  74. WORD Height;
  75. WORD Type;
  76. WORD Rowsize;
  77. DWORD DataPtr;
  78. BYTE Data[1];
  79. } BITMAP8;