annotate Media/Video/Bink_Smacker.cpp @ 2544:c674d547cc7c

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