1 /*
2 Copyright (C) 1994-1995 Apogee Software, Ltd.
3 
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8 
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 
13 See the GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18 
19 */
20 #ifndef _lumpy_
21 #define _lumpy_
22 
23 //****************************************************************************
24 //
25 // Public header for LUMPY typedefs
26 //
27 //****************************************************************************
28 
29 
30 typedef struct
31 {
32    byte     width,height;
33    byte     data;
34 } pic_t;
35 
36 #define CONVERT_ENDIAN_pic_t(pp) { }
37 
38 typedef struct
39 {
40    short     width,height;
41    short     orgx,orgy;
42    byte     data;
43 } lpic_t;
44 
45 #define CONVERT_ENDIAN_lpic_t(lp)            \
46     {                                        \
47         SwapIntelShort(&lp->width);          \
48         SwapIntelShort(&lp->height);         \
49         SwapIntelShort(&lp->orgx);           \
50         SwapIntelShort(&lp->orgy);           \
51     }
52 
53 typedef struct
54 {
55 	short height;
56    char  width[256];
57    short charofs[256];
58    byte  data;       // as much as required
59 } font_t;
60 
61 #define CONVERT_ENDIAN_font_t(fp)            \
62     {                                        \
63         int i;                               \
64         SwapIntelShort(&fp->height);         \
65         for (i = 0; i < 256; i++) {          \
66             SwapIntelShort(&fp->charofs[i]); \
67         }                                    \
68     }
69 
70 typedef struct
71 {
72    short width;
73    short height;
74    byte palette[768];
75    byte data;
76 } lbm_t;
77 
78 #define CONVERT_ENDIAN_lbm_t(lp)             \
79     {                                        \
80         SwapIntelShort(&lp->width);          \
81         SwapIntelShort(&lp->height);         \
82     }
83 
84 typedef struct
85 {
86    short          origsize;         // the orig size of "grabbed" gfx
87    short          width;            // bounding box size
88    short          height;
89    short          leftoffset;       // pixels to the left of origin
90    short          topoffset;        // pixels above the origin
91    unsigned short collumnofs[320];  // only [width] used, the [0] is &collumnofs[width]
92 } patch_t;
93 
94 #define CONVERT_ENDIAN_patch_t(pp)           \
95     {                                        \
96         int i;                               \
97         SwapIntelShort(&pp->origsize);       \
98         SwapIntelShort(&pp->width);          \
99         SwapIntelShort(&pp->height);         \
100         SwapIntelShort(&pp->leftoffset);     \
101         SwapIntelShort(&pp->topoffset);      \
102         for (i = 0; i < pp->width; i++) {          \
103             SwapIntelShort((short*)&pp->collumnofs[i]); \
104         }                                    \
105     }
106 
107 typedef struct
108 {
109    short origsize;         // the orig size of "grabbed" gfx
110    short width;            // bounding box size
111    short height;
112    short leftoffset;       // pixels to the left of origin
113    short topoffset;        // pixels above the origin
114    short translevel;
115    short collumnofs[320];  // only [width] used, the [0] is &collumnofs[width]
116 } transpatch_t;
117 
118 #define CONVERT_ENDIAN_transpatch_t(pp)      \
119     {                                        \
120         int i;                               \
121         SwapIntelShort(&pp->origsize);       \
122         SwapIntelShort(&pp->width);          \
123         SwapIntelShort(&pp->height);         \
124         SwapIntelShort(&pp->leftoffset);     \
125         SwapIntelShort(&pp->topoffset);      \
126         SwapIntelShort(&pp->translevel);     \
127         for (i = 0; i < pp->width; i++) {          \
128             SwapIntelShort((short*)&pp->collumnofs[i]); \
129         }                                    \
130     }
131 
132 typedef struct
133 {
134    byte  color;
135    short height;
136    char  width[256];
137    short charofs[256];
138    byte  pal[0x300];
139    byte  data;       // as much as required
140 } cfont_t;
141 
142 #define CONVERT_ENDIAN_cfont_t(pp)           \
143     {                                        \
144         int i;                               \
145         SwapIntelShort(&pp->height);         \
146         for (i = 0; i < 256; i++) {          \
147             SwapIntelShort(&pp->charofs[i]); \
148         }                                    \
149     }
150 
151 #endif
152