1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #ifndef AGOS_VGA_H
24 #define AGOS_VGA_H
25 
26 namespace AGOS {
27 
28 #include "common/pack-start.h"	// START STRUCT PACKING
29 
30 // Feeble Files
31 struct VgaFile1Header_Feeble {
32 	uint16 imageCount;
33 	uint16 x_2;
34 	uint16 animationCount;
35 	uint16 x_3;
36 	uint16 imageTable;
37 	uint16 x_4;
38 	uint16 animationTable;
39 	uint16 x_5;
40 } PACKED_STRUCT;
41 
42 struct ImageHeader_Feeble {
43 	uint16 id;
44 	uint16 x_1;
45 	uint16 scriptOffs;
46 	uint16 x_2;
47 } PACKED_STRUCT;
48 
49 struct AnimationHeader_Feeble {
50 	uint16 scriptOffs;
51 	uint16 x_2;
52 	uint16 id;
53 } PACKED_STRUCT;
54 
55 // Simon 1/2
56 struct ImageHeader_Simon {
57 	uint16 id;
58 	uint16 color;
59 	uint16 x_2;
60 	uint16 scriptOffs;
61 } PACKED_STRUCT;
62 
63 struct AnimationHeader_Simon {
64 	uint16 id;
65 	uint16 x_2;
66 	uint16 scriptOffs;
67 } PACKED_STRUCT;
68 
69 
70 // Elvira 1/2 and Waxworks
71 struct ImageHeader_WW {
72 	uint16 id;
73 	uint16 color;
74 	uint16 x_2;
75 	uint16 scriptOffs;
76 } PACKED_STRUCT;
77 
78 struct AnimationHeader_WW {
79 	uint16 id;
80 	uint16 x_1;
81 	uint16 x_2;
82 	uint16 scriptOffs;
83 } PACKED_STRUCT;
84 
85 // Common
86 struct VgaFile1Header_Common {
87 	uint16 x_1;
88 	uint16 imageCount;
89 	uint16 x_2;
90 	uint16 animationCount;
91 	uint16 x_3;
92 	uint16 imageTable;
93 	uint16 x_4;
94 	uint16 animationTable;
95 	uint16 x_5;
96 } PACKED_STRUCT;
97 
98 #include "common/pack-end.h"	// END STRUCT PACKING
99 
100 enum DrawFlags {
101 	kDFFlip           = 0x1,
102 	kDFNonTrans       = 0x2,
103 	kDFSkipStoreBG    = 0x4,
104 	kDFCompressed     = 0x8,
105 	kDFCompressedFlip = 0x10,
106 	kDFMasked         = 0x20,
107 
108 	// Feeble specific
109 	kDFOverlayed      = 0x10,
110 	kDFScaled         = 0x40,
111 	kDFShaded         = 0x80
112 };
113 
114 struct VC10_state {
115 	int16 image;
116 	uint16 flags;
117 	byte palette;
118 	byte paletteMod;
119 
120 	int16 x, y;
121 	uint16 width, height;
122 	uint16 draw_width, draw_height;
123 	uint16 x_skip, y_skip;
124 
125 	byte *surf2_addr;
126 	uint surf2_pitch;
127 
128 	byte *surf_addr;
129 	uint surf_pitch;
130 
131 	uint16 dl, dh;
132 
133 	const byte *srcPtr;
134 	int8 depack_cont;
135 
136 	byte depack_dest[480];
137 
VC10_stateVC10_state138 	VC10_state() { memset(this, 0, sizeof(*this)); }
139 };
140 
141 byte *vc10_depackColumn(VC10_state *vs);
142 
143 } // End of namespace AGOS
144 
145 #endif
146