annotate VideoPlayer.h @ 10:5983336e1300

Слияние
author Серик@ПончиК
date Wed, 10 Oct 2012 22:30:37 +0600
parents 8b8875f5b359
children 3fa5d0522f92
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 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15 int Width;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16 int Height;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17 int Frame;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18 int CurrentFrame;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19 int Data1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20 int FrameRate;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21 int field_18[3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22 int Flags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
23 };
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
25 struct _BINKBUF
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
26 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
27 int uWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
28 int uHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
29 int field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
30 int field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
31 int uBinkDDSurfaceType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
32 void *pDDrawSurfaceData;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
33 int uDDrawSurfacePitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
34 int field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
35 int field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
36 int field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
37 int field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
38 int field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
39 int field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
40 int field_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
41 int field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
42 int field_3C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
43 int field_40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
44 int field_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
45 struct IDirectDrawSurface *pTargetDDrawSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
46 int field_4C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
47 int uRectX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
48 int uRectY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
49 HWND hWnd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
50 int field_5C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
51 float field_60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
52 float field_64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
53 int field_68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
54 int field_6C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
55 void *pDDrawSurfaceData_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
56 int field_74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
57 int field_78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
58 };
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
59 #pragma pack(pop)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
64 #pragma pack(push, 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
65 struct MovieHeader
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
66 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
67 char pVideoName[40];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
68 unsigned int uFileOffset;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
69 };
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
70 #pragma pack(pop)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
76 void __cdecl ShowIntroVideo_and_LoadingScreen();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
81 #pragma pack(push, 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
82 struct VideoPlayer
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
83 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
84 //----- (004BE6F5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
85 inline VideoPlayer():
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
86 field_54(0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
87 pBinkMovie(nullptr), pBinkBuffer(nullptr),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
88 pSmackerMovie(nullptr), pSmackerBuffer(nullptr), pSmackMovieBlit(nullptr)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
89 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
90 //RGBTexture::RGBTexture(&pVideoPlayer->pVideoFrame);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
91 bStopBeforeSchedule = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
92 field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
93 byte_F8BC0C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
94 //pBinkMovie = nullptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
95 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
96 //----- (004BECBD) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
97 virtual ~VideoPlayer()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
98 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
99 bStopBeforeSchedule = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
100 field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
101 pVideoFrame.Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
102 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
104 void PlayDeathMovie();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
105 unsigned int SmackCheckSurfaceFromat();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
106 void Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
107 void Prepare();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
108 void Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
109 void _4BECD5(unsigned int a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
110 void BinkDrawFrame(HWND hWnd, int a3, int a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
111 void BinkUpdatePalette(HWND hWnd) {}
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
112 void SmackDrawFrame(HWND hWnd, int a3, int a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
113 void SmackUpdatePalette(HWND hWnd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
114 _BINK *OpenBink(const char *pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
115 struct _SMACK *OpenSmack(const char *pFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
116 void _4BF28F(const char *pMovieName, unsigned int a3_1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
117 bool AnyMovieLoaded();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
118 void OpenMovie(const char *pFilename, unsigned int bLoop, int a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
119 void _4BF5B2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
120 void _4BF73A();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
121 _BINKBUF *CreateBinkBuffer(HWND a1, unsigned int uWidth, unsigned int uHeight, char a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
123 static void __fastcall MovieLoop(const char *pMovieName, int a2, int a3, int a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
125
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
126 RGBTexture pVideoFrame;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
127 struct _SMACK *pSmackerMovie;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
128 struct _SMACKBUF *pSmackerBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
129 char *pSomeSmackerBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
130 int field_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
131 MovieHeader *pMightVideoHeaders;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
132 MovieHeader *pMagicVideoHeaders;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
133 int field_40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
134 int field_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
135 unsigned int uNumMightVideoHeaders;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
136 unsigned int uNumMagicVideoHeaders;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
137 int uBinkDirectDrawSurfaceType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
138 int field_54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
139 unsigned int bPlayingMovie;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
140 unsigned int bFirstFrame;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
141 unsigned int bUsingSmackerMMX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
142 unsigned int bLoopPlaying;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
143 int field_68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
144 unsigned int bStopBeforeSchedule;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
145 HWND hWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
146 struct _SMACKBLIT *pSmackMovieBlit;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
147 HANDLE hMightVid;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
148 HANDLE hMagicVid;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
149 _BINK *pBinkMovie;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
150 _BINKBUF *pBinkBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
151 char field_88[20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
152 unsigned int uMovieFormat;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
153 int dword_0000A0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
154 char pCurrentMovieName[64];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
155 char pVideoFrameTextureFilename[32];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
156 };
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
157 #pragma pack(pop)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
160
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
163 extern VideoPlayer *pVideoPlayer;