source: trunk/src/ddraw/divewrap.h@ 1036

Last change on this file since 1036 was 522, checked in by sandervl, 26 years ago

divewrap bugfixes + removal of FS save/restore macro calls

File size: 6.7 KB
Line 
1
2
3#ifndef __DIVEWRAP_H__
4 #define __DIVEWRAP_H__
5
6 #define INCL_MM_OS2
7 #include <os2sel.h>
8 #include <dive.h>
9
10 inline ULONG APIENTRY _DiveQueryCaps ( PDIVE_CAPS a,
11 ULONG b )
12 {
13 ULONG yyrc;
14 USHORT sel = RestoreOS2FS();
15
16 yyrc = DiveQueryCaps(a, b);
17 SetFS(sel);
18
19 return yyrc;
20 }
21 #undef DiveQueryCaps
22 #define DiveQueryCaps _DiveQueryCaps
23
24 inline ULONG APIENTRY _DiveOpen ( HDIVE *a,
25 BOOL b,
26 PVOID c )
27 {
28 ULONG yyrc;
29 USHORT sel = RestoreOS2FS();
30
31 yyrc = DiveOpen(a, b, c);
32 SetFS(sel);
33
34 return yyrc;
35 }
36 #undef DiveOpen
37 #define DiveOpen _DiveOpen
38
39 inline ULONG APIENTRY _DiveSetupBlitter ( HDIVE a,
40 PSETUP_BLITTER b )
41 {
42 ULONG yyrc;
43 USHORT sel = RestoreOS2FS();
44
45 yyrc = DiveSetupBlitter(a, b);
46 SetFS(sel);
47
48 return yyrc;
49 }
50 #undef DiveSetupBlitter
51 #define DiveSetupBlitter _DiveSetupBlitter
52
53 inline ULONG APIENTRY _DiveBlitImage ( HDIVE a,
54 ULONG b,
55 ULONG c )
56 {
57 ULONG yyrc;
58 USHORT sel = RestoreOS2FS();
59
60 yyrc = DiveBlitImage(a, b, c);
61 SetFS(sel);
62
63 return yyrc;
64 }
65 #undef DiveBlitImage
66 #define DiveBlitImage _DiveBlitImage
67
68 inline ULONG APIENTRY _DiveBlitImageLines ( HDIVE a,
69 ULONG b,
70 ULONG c,
71 PBYTE d )
72 {
73 ULONG yyrc;
74 USHORT sel = RestoreOS2FS();
75
76 yyrc = DiveBlitImageLines(a, b, c, d);
77 SetFS(sel);
78
79 return yyrc;
80 }
81 #undef DiveBlitImageLines
82 #define DiveBlitImageLines _DiveBlitImageLines
83
84 inline ULONG APIENTRY _DiveClose ( HDIVE a )
85 {
86 ULONG yyrc;
87 USHORT sel = RestoreOS2FS();
88
89 yyrc = DiveClose(a);
90 SetFS(sel);
91
92 return yyrc;
93 }
94 #undef DiveClose
95 #define DiveClose _DiveClose
96
97 inline ULONG APIENTRY _DiveAcquireFrameBuffer ( HDIVE a,
98 PRECTL b )
99 {
100 ULONG yyrc;
101 USHORT sel = RestoreOS2FS();
102
103 yyrc = DiveAcquireFrameBuffer(a, b);
104 SetFS(sel);
105
106 return yyrc;
107 }
108 #undef DiveAcquireFrameBuffer
109 #define DiveAcquireFrameBuffer _DiveAcquireFrameBuffer
110
111 inline ULONG APIENTRY _DiveSwitchBank ( HDIVE a,
112 ULONG b )
113 {
114 ULONG yyrc;
115 USHORT sel = RestoreOS2FS();
116
117 yyrc = DiveSwitchBank(a, b);
118 SetFS(sel);
119
120 return yyrc;
121 }
122 #undef DiveSwitchBank
123 #define DiveSwitchBank _DiveSwitchBank
124
125 inline ULONG APIENTRY _DiveDeacquireFrameBuffer ( HDIVE a )
126 {
127 ULONG yyrc;
128 USHORT sel = RestoreOS2FS();
129
130 yyrc = DiveDeacquireFrameBuffer(a);
131 SetFS(sel);
132
133 return yyrc;
134 }
135 #undef DiveDeacquireFrameBuffer
136 #define DiveDeacquireFrameBuffer _DiveDeacquireFrameBuffer
137
138 inline ULONG APIENTRY _DiveCalcFrameBufferAddress ( HDIVE a,
139 PRECTL b,
140 PBYTE *c,
141 PULONG d,
142 PULONG e )
143 {
144 ULONG yyrc;
145 USHORT sel = RestoreOS2FS();
146
147 yyrc = DiveCalcFrameBufferAddress(a, b, c, d, e);
148 SetFS(sel);
149
150 return yyrc;
151 }
152 #undef DiveCalcFrameBufferAddress
153 #define DiveCalcFrameBufferAddress _DiveCalcFrameBufferAddress
154
155 inline ULONG APIENTRY _DiveAllocImageBuffer ( HDIVE a,
156 PULONG b,
157 FOURCC c,
158 ULONG d,
159 ULONG e,
160 ULONG f,
161 PBYTE g )
162 {
163 ULONG yyrc;
164 USHORT sel = RestoreOS2FS();
165
166 yyrc = DiveAllocImageBuffer(a, b, c, d, e, f, g);
167 SetFS(sel);
168
169 return yyrc;
170 }
171 #undef DiveAllocImageBuffer
172 #define DiveAllocImageBuffer _DiveAllocImageBuffer
173
174 inline ULONG APIENTRY _DiveFreeImageBuffer ( HDIVE a,
175 ULONG b )
176 {
177 ULONG yyrc;
178 USHORT sel = RestoreOS2FS();
179
180 yyrc = DiveFreeImageBuffer(a, b);
181 SetFS(sel);
182
183 return yyrc;
184 }
185 #undef DiveFreeImageBuffer
186 #define DiveFreeImageBuffer _DiveFreeImageBuffer
187
188 inline ULONG APIENTRY _DiveBeginImageBufferAccess ( HDIVE a,
189 ULONG b,
190 PBYTE *c,
191 PULONG d,
192 PULONG e )
193 {
194 ULONG yyrc;
195 USHORT sel = RestoreOS2FS();
196
197 yyrc = DiveBeginImageBufferAccess(a, b, c, d, e);
198 SetFS(sel);
199
200 return yyrc;
201 }
202 #undef DiveBeginImageBufferAccess
203 #define DiveBeginImageBufferAccess _DiveBeginImageBufferAccess
204
205 inline ULONG APIENTRY _DiveEndImageBufferAccess ( HDIVE a,
206 ULONG b )
207 {
208 ULONG yyrc;
209 USHORT sel = RestoreOS2FS();
210
211 yyrc = DiveEndImageBufferAccess(a, b);
212 SetFS(sel);
213
214 return yyrc;
215 }
216 #undef DiveEndImageBufferAccess
217 #define DiveEndImageBufferAccess _DiveEndImageBufferAccess
218
219 inline ULONG APIENTRY _DiveSetDestinationPalette ( HDIVE a,
220 ULONG b,
221 ULONG c,
222 PBYTE d )
223 {
224 ULONG yyrc;
225 USHORT sel = RestoreOS2FS();
226
227 yyrc = DiveSetDestinationPalette(a, b, c, d);
228 SetFS(sel);
229
230 return yyrc;
231 }
232 #undef DiveSetDestinationPalette
233 #define DiveSetDestinationPalette _DiveSetDestinationPalette
234
235 inline ULONG APIENTRY _DiveSetSourcePalette ( HDIVE a,
236 ULONG b,
237 ULONG c,
238 PBYTE d )
239 {
240 ULONG yyrc;
241 USHORT sel = RestoreOS2FS();
242
243 yyrc = DiveSetSourcePalette(a, b, c, d);
244 SetFS(sel);
245
246 return yyrc;
247 }
248 #undef DiveSetSourcePalette
249 #define DiveSetSourcePalette _DiveSetSourcePalette
250
251 inline ULONG APIENTRY _DiveSetTransparentBlitMode ( HDIVE a,
252 ULONG b,
253 ULONG c,
254 ULONG d )
255 {
256 ULONG yyrc;
257 USHORT sel = RestoreOS2FS();
258
259 yyrc = DiveSetTransparentBlitMode(a, b, c, d);
260 SetFS(sel);
261
262 return yyrc;
263 }
264 #undef DiveSetTransparentBlitMode
265 #define DiveSetTransparentBlitMode _DiveSetTransparentBlitMode
266
267
268#endif
Note: See TracBrowser for help on using the repository browser.