comparison Bink_Smacker.cpp @ 0:9c0607679772

init
author Ritor1
date Sat, 12 Jan 2013 09:45:18 +0600
parents
children 6e152b7ec581
comparison
equal deleted inserted replaced
-1:000000000000 0:9c0607679772
1 #include "Bink_Smacker.h"
2
3
4
5
6
7
8
9 int (__stdcall *smackw32_SmackSoundUseMSS)(HDIGDRIVER) = 0;
10 unsigned int (__stdcall *smackw32_SmackUseMMX)(unsigned int) = 0;
11 HSMACK (__stdcall *smackw32_SmackOpen)(HANDLE, unsigned int, unsigned int) = 0;
12 HSMACKBLIT (__stdcall *smackw32_SmackBlitOpen)(unsigned int) = 0;
13 void (__stdcall *smackw32_SmackToBuffer)(HSMACK, unsigned int, unsigned int, unsigned int, unsigned int, void *, unsigned int) = 0;
14 void (__stdcall *smackw32_SmackBlitSetPalette)(HSMACKBLIT, void *, unsigned int) = 0;
15 unsigned int (__stdcall *smackw32_SmackDoFrame)(HSMACK) = 0;
16 unsigned int (__stdcall *smackw32_SmackToBufferRect)(HSMACK, unsigned int) = 0;
17 void (__stdcall *smackw32_SmackBlit)(HSMACKBLIT, void *, unsigned int, unsigned int, unsigned int, void *, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) = 0;
18 void (__stdcall *smackw32_SmackNextFrame)(HSMACK) = 0;
19 unsigned int (__stdcall *smackw32_SmackWait)(HSMACK) = 0;
20 unsigned int (__stdcall *smackw32_SmackSoundOnOff)(HSMACK, unsigned int) = 0;
21 void (__stdcall *smackw32_SmackClose)(HSMACK) = 0;
22 void (__stdcall *smackw32_SmackBufferClose)(HSMACKBUF) = 0;
23 void (__stdcall *smackw32_SmackBlitClose)(HSMACKBLIT) = 0;
24 int (__stdcall *smackw32_SmackBlitClear)(HSMACKBLIT, unsigned short *, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, int) = 0;
25 int (__stdcall *smackw32_SmackGoto)(_SMACK *, long) = 0;
26 void SMACKW32_DLL_Initialize()
27 {
28 HMODULE pDll = LoadLibraryW(L"SmackW32.dll");
29
30 smackw32_SmackSoundUseMSS = (int (__stdcall *)(HDIGDRIVER))GetProcAddress(pDll, "_SmackSoundUseMSS@4");
31 smackw32_SmackUseMMX = (unsigned int (__stdcall *)(unsigned int))GetProcAddress(pDll, "_SmackUseMMX@4");
32 smackw32_SmackOpen = (HSMACK (__stdcall *)(HANDLE, unsigned int, unsigned int))GetProcAddress(pDll, "_SmackOpen@12");
33 smackw32_SmackBlitOpen = (HSMACKBLIT (__stdcall *)(unsigned int))GetProcAddress(pDll, "_SmackBlitOpen@4");
34 smackw32_SmackToBuffer = (void (__stdcall *)(HSMACK, unsigned int, unsigned int, unsigned int, unsigned int, void *, unsigned int))GetProcAddress(pDll, "_SmackToBuffer@28");
35 smackw32_SmackBlitSetPalette = (void (__stdcall *)(HSMACKBLIT, void *, unsigned int))GetProcAddress(pDll, "_SmackBlitSetPalette@12");
36 smackw32_SmackDoFrame = (unsigned int (__stdcall *)(HSMACK))GetProcAddress(pDll, "_SmackDoFrame@4");
37 smackw32_SmackToBufferRect = (unsigned int (__stdcall *)(HSMACK, unsigned int))GetProcAddress(pDll, "_SmackToBufferRect@8");
38 smackw32_SmackBlit = (void (__stdcall *)(HSMACKBLIT, void *, unsigned int, unsigned int, unsigned int, void *, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int))GetProcAddress(pDll, "_SmackBlit@44");
39 smackw32_SmackNextFrame = (void (__stdcall *)(HSMACK))GetProcAddress(pDll, "_SmackNextFrame@4");
40 smackw32_SmackWait = (unsigned int (__stdcall *)(HSMACK))GetProcAddress(pDll, "_SmackWait@4");
41 smackw32_SmackSoundOnOff = (unsigned int (__stdcall *)(HSMACK, unsigned int))GetProcAddress(pDll, "_SmackSoundOnOff@8");
42 smackw32_SmackClose = (void (__stdcall *)(HSMACK))GetProcAddress(pDll, "_SmackClose@4");
43 smackw32_SmackBufferClose = (void (__stdcall *)(HSMACKBUF))GetProcAddress(pDll, "_SmackBufferClose@4");
44 smackw32_SmackBlitClose = (void (__stdcall *)(HSMACKBLIT))GetProcAddress(pDll, "_SmackBlitClose@4");
45 smackw32_SmackBlitClear = (int (__stdcall *)(HSMACKBLIT, unsigned short *, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, int))GetProcAddress(pDll, "_SmackBlitClear@32");
46 smackw32_SmackGoto = (int (__stdcall *)(_SMACK *, long))GetProcAddress(pDll, "_SmackGoto@8");
47 }
48
49
50
51
52
53
54 void __stdcall SmackBlitClose(HSMACKBLIT hBlit)
55 {
56 (smackw32_SmackBlitClose)(hBlit);
57 }
58
59 void __stdcall SmackBufferClose(HSMACKBUF hBuf)
60 {
61 (smackw32_SmackBufferClose)(hBuf);
62 }
63
64 void __stdcall SmackClose(HSMACK hSmack)
65 {
66 (smackw32_SmackClose)(hSmack);
67 }
68
69 unsigned int __stdcall SmackSoundOnOff(HSMACK hSmack, unsigned int bOn)
70 {
71 return (smackw32_SmackSoundOnOff)(hSmack, bOn);
72 }
73
74 unsigned int __stdcall SmackWait(HSMACK hSmack)
75 {
76 return (smackw32_SmackWait)(hSmack);
77 }
78
79 void __stdcall SmackNextFrame(HSMACK hSmack)
80 {
81 (smackw32_SmackNextFrame)(hSmack);
82 }
83
84 void __stdcall SmackBlit(HSMACKBLIT hBlit, void *pDest, unsigned int uDestPitch, unsigned int uDestX, unsigned int uDestY, void *pSrc, unsigned int uSrcPitch, unsigned int uSrcX, unsigned int uSrcY, unsigned int uSrcZ, unsigned int uSrcW)
85 {
86 (smackw32_SmackBlit)(hBlit, pDest, uDestPitch, uDestX, uDestY, pSrc, uSrcPitch, uSrcX, uSrcY, uSrcZ, uSrcW);
87 }
88
89 unsigned int __stdcall SmackToBufferRect(HSMACK hSmack, unsigned int uSmackSurface)
90 {
91 return (smackw32_SmackToBufferRect)(hSmack, uSmackSurface);
92 }
93
94 unsigned int __stdcall SmackDoFrame(HSMACK hSmack)
95 {
96 return (smackw32_SmackDoFrame)(hSmack);
97 }
98
99 void __stdcall SmackBlitSetPalette(HSMACKBLIT hBlit, void *pPalette, unsigned int uPalType)
100 {
101 (smackw32_SmackBlitSetPalette)(hBlit, pPalette, uPalType);
102 }
103
104 int __stdcall SmackSoundUseMSS(HDIGDRIVER hDrv)
105 {
106 return (smackw32_SmackSoundUseMSS)(hDrv);
107 }
108
109 unsigned int __stdcall SmackUseMMX(unsigned int flag)
110 {
111 return (smackw32_SmackUseMMX)(flag);
112 }
113
114 HSMACK __stdcall SmackOpen(HANDLE hSourceFile, unsigned int uFlags, unsigned int uExtraBuffers)
115 {
116 return (smackw32_SmackOpen)(hSourceFile, uFlags, uExtraBuffers);
117 }
118
119 HSMACKBLIT __stdcall SmackBlitOpen(unsigned int uSurfaceFormat)
120 {
121 return (smackw32_SmackBlitOpen)(uSurfaceFormat);
122 }
123
124 void __stdcall SmackToBuffer(HSMACK hSmack, unsigned int uX, unsigned int uY, unsigned int uPitch, unsigned int uHeight, void *pBuffer, unsigned int uFlags)
125 {
126 (smackw32_SmackToBuffer)(hSmack, uX, uY, uPitch, uHeight, pBuffer, uFlags);
127 }
128
129 int __stdcall SmackBlitClear(HSMACKBLIT a1, unsigned short *pFrameData, unsigned int uTargetSurfacePitch, unsigned int uOutX, unsigned int uOutY, unsigned int uOutZ, unsigned int uOutW, int a8)
130 {
131 return (smackw32_SmackBlitClear)(a1, pFrameData, uTargetSurfacePitch, uOutX, uOutY, uOutZ, uOutW, a8);
132 }
133
134 int __stdcall SmackGoto(_SMACK *a1, long a2)
135 {
136 return (smackw32_SmackGoto)(a1, a2);
137 }
138
139
140 int __stdcall SmackBufferOpen(HWND a1, long a2, long a3, long a4, long a5, long a6)
141 {
142 __asm int 3
143 return 0;
144 }
145
146 int __fastcall SmackVolumePan(long a1, long a2, _SMACK *a3, long a4, long a5, long a6)
147 {
148 __asm int 3
149 return 0;
150 }
151
152
153 // sub_4D83D0: using guessed type int __stdcall SmackBufferNewPalette(_DWORD, _DWORD, _DWORD);
154 int __stdcall SmackBufferNewPalette(long a1, long a2, long a3)
155 {
156 __asm int 3
157 return 0;
158 }
159
160 // sub_4D83D4: using guessed type int __stdcall SmackColorRemapWithTrans(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
161 int __stdcall SmackColorRemapWithTrans(long a1, long a2, long a3, long a4, long a5)
162 {
163 __asm int 3
164 return 0;
165 }
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199 int (__stdcall *binkw32_BinkDDSurfaceType)(struct IDirectDrawSurface *) = 0;
200 int (__stdcall *binkw32_BinkSetSoundSystem)(void *, HDIGDRIVER) = 0;
201 int (__stdcall *binkw32_BinkOpenMiles)(int) = 0;
202 HBINK (__stdcall *binkw32_BinkOpen)(void *, unsigned int) = 0;
203 int (__stdcall *binkw32_BinkWait)(HBINK) = 0;
204 int (__stdcall *binkw32_BinkDoFrame)(HBINK) = 0;
205 int (__stdcall *binkw32_BinkNextFrame)(HBINK) = 0;
206 int (__stdcall *binkw32_BinkGetRects)(HBINK, unsigned int) = 0;
207 int (__stdcall *binkw32_BinkCopyToBuffer)(HBINK, void *, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) = 0;
208 int (__stdcall *binkw32_BinkPause)(HBINK, int) = 0;
209 int (__stdcall *binkw32_BinkClose)(HBINK) = 0;
210 int (__stdcall *binkw32_BinkBufferSetOffset)(void *, int, int) = 0;
211 int (__stdcall *binkw32_BinkBufferSetScale)(void *, unsigned int, unsigned int) = 0;
212 void BINKW32_DLL_Initialize()
213 {
214 HMODULE pDll = LoadLibraryW(L"BinkW32.dll");
215
216 binkw32_BinkDDSurfaceType = (int (__stdcall *)(struct IDirectDrawSurface *))GetProcAddress(pDll, "_BinkDDSurfaceType@4");
217 binkw32_BinkSetSoundSystem = (int (__stdcall *)(void *, HDIGDRIVER))GetProcAddress(pDll, "_BinkSetSoundSystem@8");
218 binkw32_BinkOpenMiles = (int (__stdcall *)(int))GetProcAddress(pDll, "_BinkOpenMiles@4");
219 binkw32_BinkOpen = (HBINK (__stdcall *)(void *, unsigned int))GetProcAddress(pDll, "_BinkOpen@8");
220 binkw32_BinkWait = (int (__stdcall *)(HBINK))GetProcAddress(pDll, "_BinkWait@4");
221 binkw32_BinkBufferSetOffset = (int (__stdcall *)(void *, int, int))GetProcAddress(pDll, "_BinkBufferSetOffset@12");
222 binkw32_BinkBufferSetScale = (int (__stdcall *)(void *, unsigned int, unsigned int))GetProcAddress(pDll, "_BinkBufferSetScale@12");
223 binkw32_BinkDoFrame = (int (__stdcall *)(HBINK))GetProcAddress(pDll, "_BinkDoFrame@4");
224 binkw32_BinkNextFrame = (int (__stdcall *)(HBINK))GetProcAddress(pDll, "_BinkNextFrame@4");
225 binkw32_BinkGetRects = (int (__stdcall *)(HBINK, unsigned int))GetProcAddress(pDll, "_BinkGetRects@8");
226 binkw32_BinkCopyToBuffer = (int (__stdcall *)(HBINK, void *, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int))GetProcAddress(pDll, "_BinkCopyToBuffer@28");
227 binkw32_BinkPause = (int (__stdcall *)(HBINK, int))GetProcAddress(pDll, "_BinkPause@8");
228 binkw32_BinkClose = (int (__stdcall *)(HBINK))GetProcAddress(pDll, "_BinkClose@4");
229 }
230
231
232 int __stdcall BinkPause(HBINK hBink, int bPause)
233 {
234 return (binkw32_BinkPause)(hBink, bPause);
235 }
236
237 int __stdcall BinkClose(HBINK hBink)
238 {
239 return (binkw32_BinkClose)(hBink);
240 }
241
242 int __stdcall BinkGetRects(HBINK hBink, unsigned int uFlags)
243 {
244 return (binkw32_BinkGetRects)(hBink, uFlags);
245 }
246
247 int __stdcall BinkCopyToBuffer(HBINK hBink, void *pBuffer, unsigned int lPitch, unsigned int uNumScanlines, unsigned int uX, unsigned int uY, unsigned int uFlags)
248 {
249 return (binkw32_BinkCopyToBuffer)(hBink, pBuffer, lPitch, uNumScanlines, uX, uY, uFlags);
250 }
251
252 int __stdcall BinkDoFrame(HBINK hBink)
253 {
254 return (binkw32_BinkDoFrame)(hBink);
255 }
256
257 int __stdcall BinkNextFrame(HBINK hBink)
258 {
259 return (binkw32_BinkNextFrame)(hBink);
260 }
261
262 HBINK __stdcall BinkOpen(void *hFileHandle, unsigned int uFlags)
263 {
264 return (binkw32_BinkOpen)(hFileHandle, uFlags);
265 }
266
267 int __stdcall BinkOpenMiles(int unk)
268 {
269 return (binkw32_BinkOpenMiles)(unk);
270 }
271
272 int __stdcall BinkWait(HBINK hBink)
273 {
274 return (binkw32_BinkWait)(hBink);
275 }
276
277
278
279 int __stdcall BinkBufferSetOffset(void *pStruct, int b, int c)
280 {
281 return (binkw32_BinkBufferSetOffset)(pStruct, b, c);
282 }
283
284 int __stdcall BinkBufferSetScale(void *pStruct, unsigned int uWidth, unsigned int uHeight)
285 {
286 return (binkw32_BinkBufferSetScale)(pStruct, uWidth, uHeight);
287 }
288
289 int __stdcall BinkDDSurfaceType(struct IDirectDrawSurface *pDDS)
290 {
291 return (binkw32_BinkDDSurfaceType)(pDDS);
292 }
293
294 int __stdcall BinkSetSoundSystem(void *pSoundSystem, HDIGDRIVER hDrv)
295 {
296 return (binkw32_BinkSetSoundSystem)(pSoundSystem, hDrv);
297 }
298
299
300
301
302
303
304 int __stdcall BinkGoto(_BINK *a1, long a2, long a3)
305 {
306 __asm int 3
307 return 0;
308 }
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328