annotate VideoPlayer.h @ 32:77de07f99e03

16.10.12 9.09
author Ritor1
date Tue, 16 Oct 2012 09:09:53 +0600
parents 3fa5d0522f92
children
rev   line source
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1 #pragma once
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2 #include "OSAPI.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4 #include "Texture.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5 #include "mm7_data.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9 #pragma pack(push, 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13 struct _BINK
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14 {
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
15 int uWidth;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
16 int uHeight;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
17 };
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
18
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
19 struct _BINK_1_5_21_0: public _BINK
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
20 {
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
21 int uNumFrames;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
22 int uCurrentFrame;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
23 int Data1;
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
24 int uFrameRate;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
25 int field_18[3];
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
26 int uFlags;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
27 };
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
28
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
29 struct _BINK_3_0_0_0: public _BINK
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
30 {
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
31 int unk_0;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
32 int unk_1;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
33 int uNumFrames;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
34 int uCurrentFrame;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
35 int _unk2;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
36 int _unk_[10];
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
37 };
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
38
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
39
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
40 struct _BINKBUF
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
41 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
42 int uWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
43 int uHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
44 int field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
45 int field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
46 int uBinkDDSurfaceType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
47 void *pDDrawSurfaceData;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
48 int uDDrawSurfacePitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
49 int field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
50 int field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
51 int field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
52 int field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
53 int field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
54 int field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
55 int field_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
56 int field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
57 int field_3C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
58 int field_40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
59 int field_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
60 struct IDirectDrawSurface *pTargetDDrawSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
61 int field_4C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
62 int uRectX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
63 int uRectY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
64 HWND hWnd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
65 int field_5C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
66 float field_60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
67 float field_64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
68 int field_68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
69 int field_6C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
70 void *pDDrawSurfaceData_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
71 int field_74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
72 int field_78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
73 };
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
74 struct _BINKBUF_1_5_21_0: public _BINKBUF
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
75 {
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
76 int field_7C;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
77 int field_80;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
78 int field_84;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
79 int field_88;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
80 int field_8C;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
81 int field_90;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
82 int field_94;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
83 int field_98;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
84 int field_9C;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
85 int field_A0;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
86 };
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
87
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
88 struct _BINKBUF_3_0_0_0: public _BINKBUF
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
89 {
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
90 };
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
91 #pragma pack(pop)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
92
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
96 #pragma pack(push, 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
97 struct MovieHeader
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
98 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
99 char pVideoName[40];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
100 unsigned int uFileOffset;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
101 };
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
102 #pragma pack(pop)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
105
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
108 void __cdecl ShowIntroVideo_and_LoadingScreen();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
110
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
111
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
112
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
113 #pragma pack(push, 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
114 struct VideoPlayer
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
115 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
116 //----- (004BE6F5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
117 inline VideoPlayer():
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
118 field_54(0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
119 pBinkMovie(nullptr), pBinkBuffer(nullptr),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
120 pSmackerMovie(nullptr), pSmackerBuffer(nullptr), pSmackMovieBlit(nullptr)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
121 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
122 //RGBTexture::RGBTexture(&pVideoPlayer->pVideoFrame);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
123 bStopBeforeSchedule = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
124 field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
125 byte_F8BC0C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
126 //pBinkMovie = nullptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
127 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
128 //----- (004BECBD) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
129 virtual ~VideoPlayer()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
130 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
131 bStopBeforeSchedule = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
132 field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
133 pVideoFrame.Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
134 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
135
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
136 void PlayDeathMovie();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
137 unsigned int SmackCheckSurfaceFromat();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
138 void Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
139 void Prepare();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
140 void Unload();
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 0
diff changeset
141 void FastForwardToFrame(unsigned int uFrameNum);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
142 void BinkDrawFrame(HWND hWnd, int a3, int a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
143 void BinkUpdatePalette(HWND hWnd) {}
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
144 void SmackDrawFrame(HWND hWnd, int a3, int a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
145 void SmackUpdatePalette(HWND hWnd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
146 _BINK *OpenBink(const char *pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
147 struct _SMACK *OpenSmack(const char *pFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
148 void _4BF28F(const char *pMovieName, unsigned int a3_1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
149 bool AnyMovieLoaded();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
150 void OpenMovie(const char *pFilename, unsigned int bLoop, int a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
151 void _4BF5B2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
152 void _4BF73A();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
153 _BINKBUF *CreateBinkBuffer(HWND a1, unsigned int uWidth, unsigned int uHeight, char a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
154
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
155 static void __fastcall MovieLoop(const char *pMovieName, int a2, int a3, int a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
156
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
157
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
158 RGBTexture pVideoFrame;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
159 struct _SMACK *pSmackerMovie;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
160 struct _SMACKBUF *pSmackerBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
161 char *pSomeSmackerBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
162 int field_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
163 MovieHeader *pMightVideoHeaders;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
164 MovieHeader *pMagicVideoHeaders;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
165 int field_40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
166 int field_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
167 unsigned int uNumMightVideoHeaders;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
168 unsigned int uNumMagicVideoHeaders;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
169 int uBinkDirectDrawSurfaceType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
170 int field_54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
171 unsigned int bPlayingMovie;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
172 unsigned int bFirstFrame;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
173 unsigned int bUsingSmackerMMX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
174 unsigned int bLoopPlaying;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
175 int field_68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
176 unsigned int bStopBeforeSchedule;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
177 HWND hWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
178 struct _SMACKBLIT *pSmackMovieBlit;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
179 HANDLE hMightVid;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
180 HANDLE hMagicVid;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
181 _BINK *pBinkMovie;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
182 _BINKBUF *pBinkBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
183 char field_88[20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
184 unsigned int uMovieFormat;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
185 int dword_0000A0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
186 char pCurrentMovieName[64];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
187 char pVideoFrameTextureFilename[32];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
188 };
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
189 #pragma pack(pop)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
190
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
191
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
192
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
194
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
195 extern VideoPlayer *pVideoPlayer;