annotate Bink_Smacker.h @ 2185:385040580292

CastSpell continue
author Ritor1
date Mon, 27 Jan 2014 00:13:01 +0600
parents ba3de1337989
children d57505d3c70c
rev   line source
0
Ritor1
parents:
diff changeset
1 #pragma once
Ritor1
parents:
diff changeset
2 #include "AIL.h"
Ritor1
parents:
diff changeset
3
Ritor1
parents:
diff changeset
4
Ritor1
parents:
diff changeset
5
Ritor1
parents:
diff changeset
6
Ritor1
parents:
diff changeset
7 void BINKW32_DLL_Initialize();
Ritor1
parents:
diff changeset
8
Ritor1
parents:
diff changeset
9
Ritor1
parents:
diff changeset
10 int __stdcall BinkDDSurfaceType(struct IDirectDrawSurface *);
Ritor1
parents:
diff changeset
11 int __stdcall BinkSetSoundSystem(void *pSoundSystem, HDIGDRIVER hDrv);
Ritor1
parents:
diff changeset
12 int __stdcall BinkOpenMiles(int);
Ritor1
parents:
diff changeset
13 HBINK __stdcall BinkOpen(void *hFileHandle, unsigned int uFlags);
Ritor1
parents:
diff changeset
14 int __stdcall BinkWait(HBINK);
Ritor1
parents:
diff changeset
15 int __stdcall BinkDoFrame(HBINK);
Ritor1
parents:
diff changeset
16 int __stdcall BinkNextFrame(HBINK);
Ritor1
parents:
diff changeset
17 int __stdcall BinkGetRects(HBINK hBink, unsigned int uFlags);
Ritor1
parents:
diff changeset
18 int __stdcall BinkCopyToBuffer(HBINK hBink, void *pBuffer, unsigned int lPitch, unsigned int uNumLines, unsigned int uX, unsigned int uY, unsigned int uFlags);
Ritor1
parents:
diff changeset
19 int __stdcall BinkPause(HBINK, int bPause);
Ritor1
parents:
diff changeset
20 int __stdcall BinkClose(HBINK);
Ritor1
parents:
diff changeset
21 int __stdcall BinkGoto(HBINK, long a2, long a3);
Ritor1
parents:
diff changeset
22
Ritor1
parents:
diff changeset
23 int __stdcall BinkBufferSetOffset(void *, int, int);
Ritor1
parents:
diff changeset
24 int __stdcall BinkBufferSetScale(void *, unsigned int uWidth, unsigned int uHeight);
Ritor1
parents:
diff changeset
25
Ritor1
parents:
diff changeset
26
Ritor1
parents:
diff changeset
27
Ritor1
parents:
diff changeset
28
Ritor1
parents:
diff changeset
29
Ritor1
parents:
diff changeset
30
Ritor1
parents:
diff changeset
31
Ritor1
parents:
diff changeset
32
Ritor1
parents:
diff changeset
33
Ritor1
parents:
diff changeset
34
Ritor1
parents:
diff changeset
35
Ritor1
parents:
diff changeset
36
Ritor1
parents:
diff changeset
37
Ritor1
parents:
diff changeset
38
Ritor1
parents:
diff changeset
39
Ritor1
parents:
diff changeset
40
Ritor1
parents:
diff changeset
41
Ritor1
parents:
diff changeset
42 void SMACKW32_DLL_Initialize();
Ritor1
parents:
diff changeset
43
Ritor1
parents:
diff changeset
44 struct _SMACK
Ritor1
parents:
diff changeset
45 {
Ritor1
parents:
diff changeset
46 unsigned int Version; // SMK2 only right now
Ritor1
parents:
diff changeset
47 unsigned int Width; // Width (1 based, 640 for example)
Ritor1
parents:
diff changeset
48 unsigned int Height; // Height (1 based, 480 for example)
Ritor1
parents:
diff changeset
49 unsigned int Frames; // Number of frames (1 based, 100 = 100 frames)
Ritor1
parents:
diff changeset
50 unsigned int MSPerFrame; // Frame Rate
Ritor1
parents:
diff changeset
51 unsigned int SmackerType; // bit 0 set=ring frame
Ritor1
parents:
diff changeset
52 unsigned int LargestInTrack[7]; // Largest single size for each track
Ritor1
parents:
diff changeset
53 unsigned int tablesize; // Size of the init tables
Ritor1
parents:
diff changeset
54 unsigned int codesize; // Compression info
Ritor1
parents:
diff changeset
55 unsigned int absize; // ditto
Ritor1
parents:
diff changeset
56 unsigned int detailsize; // ditto
Ritor1
parents:
diff changeset
57 unsigned int typesize; // ditto
Ritor1
parents:
diff changeset
58 unsigned int TrackType[7]; // high byte=0x80-Comp,0x40-PCM data,0x20-16 bit,0x10-stereo
Ritor1
parents:
diff changeset
59 unsigned int extra; // extra value (should be zero)
Ritor1
parents:
diff changeset
60 unsigned int NewPalette; // set to one if the palette changed
Ritor1
parents:
diff changeset
61 unsigned char Palette[772]; // palette data
Ritor1
parents:
diff changeset
62 unsigned int PalType; // type of palette
Ritor1
parents:
diff changeset
63 unsigned int FrameNum; // 0374 Frame Number to be displayed
Ritor1
parents:
diff changeset
64 unsigned int FrameSize; // The current frame's size in bytes
Ritor1
parents:
diff changeset
65 unsigned int SndSize; // The current frame sound tracks' size in bytes
Ritor1
parents:
diff changeset
66 int LastRectx; // 0380 Rect set in from SmackToBufferRect (X coord)
Ritor1
parents:
diff changeset
67 int LastRecty; // Rect set in from SmackToBufferRect (Y coord)
Ritor1
parents:
diff changeset
68 int LastRectw; // Rect set in from SmackToBufferRect (Width)
Ritor1
parents:
diff changeset
69 int LastRecth; // 038C Rect set in from SmackToBufferRect (Height)
Ritor1
parents:
diff changeset
70 unsigned int OpenFlags; // flags used on open
Ritor1
parents:
diff changeset
71 unsigned int LeftOfs; // Left Offset used in SmackTo
Ritor1
parents:
diff changeset
72 unsigned int TopOfs; // Top Offset used in SmackTo
Ritor1
parents:
diff changeset
73 unsigned int LargestFrameSize; // Largest frame size
Ritor1
parents:
diff changeset
74 unsigned int Highest1SecRate; // Highest 1 sec data rate
Ritor1
parents:
diff changeset
75 unsigned int Highest1SecFrame; // Highest 1 sec data rate starting frame
Ritor1
parents:
diff changeset
76 unsigned int ReadError; // Set to non-zero if a read error has ocurred
Ritor1
parents:
diff changeset
77 unsigned int addr32; // translated address for 16 bit interface
Ritor1
parents:
diff changeset
78 };
Ritor1
parents:
diff changeset
79
Ritor1
parents:
diff changeset
80
Ritor1
parents:
diff changeset
81
Ritor1
parents:
diff changeset
82 struct _SMACKBLIT
Ritor1
parents:
diff changeset
83 {
Ritor1
parents:
diff changeset
84 unsigned int Flags;
Ritor1
parents:
diff changeset
85 unsigned char *Palette;
Ritor1
parents:
diff changeset
86 unsigned int PalType;
Ritor1
parents:
diff changeset
87 unsigned short *SmoothTable;
Ritor1
parents:
diff changeset
88 unsigned short *Conv8to16Table;
Ritor1
parents:
diff changeset
89 unsigned int whichmode;
Ritor1
parents:
diff changeset
90 unsigned int palindex;
Ritor1
parents:
diff changeset
91 unsigned int t16index;
Ritor1
parents:
diff changeset
92 unsigned int smoothindex;
Ritor1
parents:
diff changeset
93 unsigned int smoothtype;
Ritor1
parents:
diff changeset
94 unsigned int firstpalette;
Ritor1
parents:
diff changeset
95 };
Ritor1
parents:
diff changeset
96
Ritor1
parents:
diff changeset
97 struct _SMACKBUF
Ritor1
parents:
diff changeset
98 {
Ritor1
parents:
diff changeset
99 unsigned int Reversed; // 1 if the buffer is upside down
Ritor1
parents:
diff changeset
100 unsigned int SurfaceType; // SMACKSURFACExxxx defines
Ritor1
parents:
diff changeset
101 unsigned int BlitType; // SMACKxxxxBLIT defines
Ritor1
parents:
diff changeset
102 unsigned int FullScreen; // 1 if full-screen
Ritor1
parents:
diff changeset
103 unsigned int Width;
Ritor1
parents:
diff changeset
104 unsigned int Height;
Ritor1
parents:
diff changeset
105 unsigned int Pitch;
Ritor1
parents:
diff changeset
106 unsigned int Zoomed;
Ritor1
parents:
diff changeset
107 unsigned int ZWidth;
Ritor1
parents:
diff changeset
108 unsigned int ZHeight;
Ritor1
parents:
diff changeset
109 unsigned int DispColors; // colors on the screen
Ritor1
parents:
diff changeset
110 unsigned int MaxPalColors; // total possible colors in palette (usually 256)
Ritor1
parents:
diff changeset
111 unsigned int PalColorsInUse; // Used colors in palette (usually 236)
Ritor1
parents:
diff changeset
112 unsigned int StartPalColor; // first usable color index (usually 10)
Ritor1
parents:
diff changeset
113 unsigned int EndPalColor; // last usable color index (usually 246)
Ritor1
parents:
diff changeset
114 RGBQUAD Palette[256];
Ritor1
parents:
diff changeset
115 unsigned int PalType;
Ritor1
parents:
diff changeset
116 unsigned int forceredraw; // force a complete redraw on next blit (for >8bit)
Ritor1
parents:
diff changeset
117 unsigned int didapalette; // force an invalidate on the next palette change
Ritor1
parents:
diff changeset
118
Ritor1
parents:
diff changeset
119 void * Buffer;
Ritor1
parents:
diff changeset
120 void * DIBRestore;
Ritor1
parents:
diff changeset
121 unsigned int OurBitmap;
Ritor1
parents:
diff changeset
122 unsigned int OrigBitmap;
Ritor1
parents:
diff changeset
123 unsigned int OurPalette;
Ritor1
parents:
diff changeset
124 unsigned int WinGDC;
Ritor1
parents:
diff changeset
125 unsigned int FullFocused;
Ritor1
parents:
diff changeset
126 unsigned int ParentHwnd;
Ritor1
parents:
diff changeset
127 unsigned int OldParWndProc;
Ritor1
parents:
diff changeset
128 unsigned int OldDispWndProc;
Ritor1
parents:
diff changeset
129 unsigned int DispHwnd;
Ritor1
parents:
diff changeset
130 unsigned int WinGBufHandle;
Ritor1
parents:
diff changeset
131 void * lpDD;
Ritor1
parents:
diff changeset
132 void * lpDDSP;
Ritor1
parents:
diff changeset
133 unsigned int DDSurfaceType;
Ritor1
parents:
diff changeset
134 struct _SMACKBLIT DDblit;
Ritor1
parents:
diff changeset
135 int ddSoftwarecur;
Ritor1
parents:
diff changeset
136 int didaddblit;
Ritor1
parents:
diff changeset
137 int lastwasdd;
Ritor1
parents:
diff changeset
138 RECT ddscreen;
Ritor1
parents:
diff changeset
139 int manyblits;
Ritor1
parents:
diff changeset
140 int * blitrects;
Ritor1
parents:
diff changeset
141 int * rectsptr;
Ritor1
parents:
diff changeset
142 int maxrects;
Ritor1
parents:
diff changeset
143 int numrects;
Ritor1
parents:
diff changeset
144 HDC lastdc;
Ritor1
parents:
diff changeset
145 };
2125
ba3de1337989 house animations working
zipi
parents: 2079
diff changeset
146 #define BINKFRAMERATE 0x00001000L // Override fr (call BinkFrameRate first)
ba3de1337989 house animations working
zipi
parents: 2079
diff changeset
147 #define BINKPRELOADALL 0x00002000L // Preload the entire animation
ba3de1337989 house animations working
zipi
parents: 2079
diff changeset
148 #define BINKSNDTRACK 0x00004000L // Set the track number to play
ba3de1337989 house animations working
zipi
parents: 2079
diff changeset
149 #define BINKOLDFRAMEFORMAT 0x00008000L // using the old Bink frame format (internal use only)
ba3de1337989 house animations working
zipi
parents: 2079
diff changeset
150 #define BINKRBINVERT 0x00010000L // use reversed R and B planes (internal use only)
ba3de1337989 house animations working
zipi
parents: 2079
diff changeset
151 #define BINKGRAYSCALE 0x00020000L // Force Bink to use grayscale
ba3de1337989 house animations working
zipi
parents: 2079
diff changeset
152 #define BINKNOMMX 0x00040000L // Don't use MMX
ba3de1337989 house animations working
zipi
parents: 2079
diff changeset
153 #define BINKNOSKIP 0x00080000L // Don't skip frames if falling behind
ba3de1337989 house animations working
zipi
parents: 2079
diff changeset
154 #define BINKALPHA 0x00100000L // Decompress alpha plane (if present)
ba3de1337989 house animations working
zipi
parents: 2079
diff changeset
155 #define BINKNOFILLIOBUF 0x00200000L // Fill the IO buffer in SmackOpen
ba3de1337989 house animations working
zipi
parents: 2079
diff changeset
156 #define BINKSIMULATE 0x00400000L // Simulate the speed (call BinkSim first)
ba3de1337989 house animations working
zipi
parents: 2079
diff changeset
157 #define BINKFILEHANDLE 0x00800000L // Use when passing in a file handle
ba3de1337989 house animations working
zipi
parents: 2079
diff changeset
158 #define BINKIOSIZE 0x01000000L // Set an io size (call BinkIOSize first)
ba3de1337989 house animations working
zipi
parents: 2079
diff changeset
159 #define BINKIOPROCESSOR 0x02000000L // Set an io processor (call BinkIO first)
ba3de1337989 house animations working
zipi
parents: 2079
diff changeset
160 #define BINKFROMMEMORY 0x04000000L // Use when passing in a pointer to the file
ba3de1337989 house animations working
zipi
parents: 2079
diff changeset
161 #define BINKNOTHREADEDIO 0x08000000L // Don't use a background thread for IO
ba3de1337989 house animations working
zipi
parents: 2079
diff changeset
162
ba3de1337989 house animations working
zipi
parents: 2079
diff changeset
163 #define BINKSURFACEFAST 0x00000000L
ba3de1337989 house animations working
zipi
parents: 2079
diff changeset
164 #define BINKSURFACESLOW 0x08000000L
ba3de1337989 house animations working
zipi
parents: 2079
diff changeset
165 #define BINKSURFACEDIRECT 0x04000000L
ba3de1337989 house animations working
zipi
parents: 2079
diff changeset
166
ba3de1337989 house animations working
zipi
parents: 2079
diff changeset
167 #define BINKCOPYALL 0x80000000L // copy all pixels (not just changed)
ba3de1337989 house animations working
zipi
parents: 2079
diff changeset
168 #define BINKCOPY2XH 0x10000000L // Force doubling height scaling
ba3de1337989 house animations working
zipi
parents: 2079
diff changeset
169 #define BINKCOPY2XHI 0x20000000L // Force interleaving height scaling
ba3de1337989 house animations working
zipi
parents: 2079
diff changeset
170 #define BINKCOPY2XW 0x30000000L // copy the width zoomed by two
ba3de1337989 house animations working
zipi
parents: 2079
diff changeset
171 #define BINKCOPY2XWH 0x40000000L // copy the width and height zoomed by two
ba3de1337989 house animations working
zipi
parents: 2079
diff changeset
172 #define BINKCOPY2XWHI 0x50000000L // copy the width and height zoomed by two
ba3de1337989 house animations working
zipi
parents: 2079
diff changeset
173 #define BINKCOPY1XI 0x60000000L // copy the width and height zoomed by two
ba3de1337989 house animations working
zipi
parents: 2079
diff changeset
174 #define BINKCOPYNOSCALING 0x70000000L // Force scaling off
0
Ritor1
parents:
diff changeset
175
2079
ba5cd8a8a0d3 smacker flags
Gloval
parents: 1035
diff changeset
176 #define SMACKNEEDPAN 0x00020L // Will be setting the pan
ba5cd8a8a0d3 smacker flags
Gloval
parents: 1035
diff changeset
177 #define SMACKNEEDVOLUME 0x00040L // Will be setting the volume
ba5cd8a8a0d3 smacker flags
Gloval
parents: 1035
diff changeset
178 #define SMACKFRAMERATE 0x00080L // Override fr (call SmackFrameRate first)
ba5cd8a8a0d3 smacker flags
Gloval
parents: 1035
diff changeset
179 #define SMACKLOADEXTRA 0x00100L // Load the extra buffer during SmackOpen
ba5cd8a8a0d3 smacker flags
Gloval
parents: 1035
diff changeset
180 #define SMACKPRELOADALL 0x00200L // Preload the entire animation
ba5cd8a8a0d3 smacker flags
Gloval
parents: 1035
diff changeset
181 #define SMACKNOSKIP 0x00400L // Don't skip frames if falling behind
ba5cd8a8a0d3 smacker flags
Gloval
parents: 1035
diff changeset
182 #define SMACKSIMULATE 0x00800L // Simulate the speed (call SmackSim first)
ba5cd8a8a0d3 smacker flags
Gloval
parents: 1035
diff changeset
183 #define SMACKFILEHANDLE 0x01000L // Use when passing in a file handle
ba5cd8a8a0d3 smacker flags
Gloval
parents: 1035
diff changeset
184 #define SMACKTRACK1 0x02000L // Play audio track 1
ba5cd8a8a0d3 smacker flags
Gloval
parents: 1035
diff changeset
185 #define SMACKTRACK2 0x04000L // Play audio track 2
ba5cd8a8a0d3 smacker flags
Gloval
parents: 1035
diff changeset
186 #define SMACKTRACK3 0x08000L // Play audio track 3
ba5cd8a8a0d3 smacker flags
Gloval
parents: 1035
diff changeset
187 #define SMACKTRACK4 0x10000L // Play audio track 4
ba5cd8a8a0d3 smacker flags
Gloval
parents: 1035
diff changeset
188 #define SMACKTRACK5 0x20000L // Play audio track 5
ba5cd8a8a0d3 smacker flags
Gloval
parents: 1035
diff changeset
189 #define SMACKTRACK6 0x40000L // Play audio track 6
ba5cd8a8a0d3 smacker flags
Gloval
parents: 1035
diff changeset
190 #define SMACKTRACK7 0x80000L // Play audio track 7
ba5cd8a8a0d3 smacker flags
Gloval
parents: 1035
diff changeset
191
ba5cd8a8a0d3 smacker flags
Gloval
parents: 1035
diff changeset
192
1035
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 347
diff changeset
193 #define SMACKBUFFER555 0x80000000
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 347
diff changeset
194 #define SMACKBUFFER565 0xC0000000
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 347
diff changeset
195
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 347
diff changeset
196 #define SMACKBLIT1X 1
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 347
diff changeset
197 #define SMACKBLIT2X 2
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 347
diff changeset
198 #define SMACKBLIT2XSMOOTHING 4
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 347
diff changeset
199 #define SMACKBLIT2XINTERLACE 8
0
Ritor1
parents:
diff changeset
200
Ritor1
parents:
diff changeset
201
Ritor1
parents:
diff changeset
202 int __stdcall SmackSoundUseMSS(HDIGDRIVER hDrv);
Ritor1
parents:
diff changeset
203 unsigned int __stdcall SmackUseMMX(unsigned int flag);
Ritor1
parents:
diff changeset
204 HSMACK __stdcall SmackOpen(HANDLE hSourceFile, unsigned int uFlags, unsigned int uExtraBuffers);
Ritor1
parents:
diff changeset
205 HSMACKBLIT __stdcall SmackBlitOpen(unsigned int uSurfaceFormat);
Ritor1
parents:
diff changeset
206 void __stdcall SmackToBuffer(HSMACK, unsigned int uX, unsigned int uY, unsigned int uPitch, unsigned int uHeight, void *pBuffer, unsigned int uFlags);
Ritor1
parents:
diff changeset
207 void __stdcall SmackBlitSetPalette(HSMACKBLIT hBlit, void *pPalette, unsigned int uPalType);
Ritor1
parents:
diff changeset
208 unsigned int __stdcall SmackDoFrame(HSMACK);
Ritor1
parents:
diff changeset
209 unsigned int __stdcall SmackToBufferRect(HSMACK, unsigned int uSmackSurface);
Ritor1
parents:
diff changeset
210 void __stdcall SmackBlit(HSMACKBLIT, 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);
Ritor1
parents:
diff changeset
211 void __stdcall SmackNextFrame(HSMACK);
Ritor1
parents:
diff changeset
212 unsigned int __stdcall SmackWait(HSMACK);
Ritor1
parents:
diff changeset
213 unsigned int __stdcall SmackSoundOnOff(HSMACK, unsigned int bOn);
Ritor1
parents:
diff changeset
214 void __stdcall SmackClose(HSMACK);
Ritor1
parents:
diff changeset
215 void __stdcall SmackBufferClose(HSMACKBUF);
Ritor1
parents:
diff changeset
216 void __stdcall SmackBlitClose(HSMACKBLIT);
Ritor1
parents:
diff changeset
217 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);
Ritor1
parents:
diff changeset
218
Ritor1
parents:
diff changeset
219
Ritor1
parents:
diff changeset
220
Ritor1
parents:
diff changeset
221
Ritor1
parents:
diff changeset
222
Ritor1
parents:
diff changeset
223 int __stdcall SmackBufferOpen(HWND a1, long a2, long a3, long a4, long a5, long a6);
347
c067c5739e1f minor fixes
zipi
parents: 0
diff changeset
224 int __fastcall SmackVolumePan(_SMACK *a3, long a4, long a5, long a6);
0
Ritor1
parents:
diff changeset
225
Ritor1
parents:
diff changeset
226 int __stdcall SmackGoto(_SMACK *a1, long a2);
Ritor1
parents:
diff changeset
227
Ritor1
parents:
diff changeset
228 // sub_4D83D0: using guessed type int __stdcall SmackBufferNewPalette(_DWORD, _DWORD, _DWORD);
2125
ba3de1337989 house animations working
zipi
parents: 2079
diff changeset
229 void __stdcall SmackBufferNewPalette(HSMACKBUF a1, void *a2, unsigned int a3);
0
Ritor1
parents:
diff changeset
230
Ritor1
parents:
diff changeset
231 // sub_4D83D4: using guessed type int __stdcall SmackColorRemapWithTrans(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
2125
ba3de1337989 house animations working
zipi
parents: 2079
diff changeset
232 void __stdcall SmackColorRemapWithTrans(_SMACK *a1, void *a2, unsigned int a3, unsigned int a4, unsigned int a5);
0
Ritor1
parents:
diff changeset
233
Ritor1
parents:
diff changeset
234
Ritor1
parents:
diff changeset
235
Ritor1
parents:
diff changeset
236
Ritor1
parents:
diff changeset
237
Ritor1
parents:
diff changeset
238
Ritor1
parents:
diff changeset
239
Ritor1
parents:
diff changeset
240
Ritor1
parents:
diff changeset
241
Ritor1
parents:
diff changeset
242
Ritor1
parents:
diff changeset
243
Ritor1
parents:
diff changeset
244
Ritor1
parents:
diff changeset
245
Ritor1
parents:
diff changeset
246