annotate VideoPlayer.cpp @ 70:47736b43558d

Party movement & ItemsTable::GenerateItem stack fix
author Nomad
date Sat, 27 Oct 2012 20:48:36 +0200
parents 5159d2e6f559
children a84fb3752681
rev   line source
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1 #include "OSAPI.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3 #include "Bink_Smacker.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5 #include "OSInfo.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6 #include "VideoPlayer.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7 #include "AudioPlayer.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8 #include "Game.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9 #include "Render.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10 #include "Party.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11 #include "GUIWindow.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12 #include "Allocator.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13 #include "Time.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14 #include "Log.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16 #include "mm7_data.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19 VideoPlayer *pVideoPlayer = nullptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
26
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
27 #pragma comment(lib, "Version.lib")
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
28 bool GetDllVersion(const wchar_t *pDllName, uint *pMajor, uint *pMinor)
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
29 {
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
30 uint uVersionSize = GetFileVersionInfoSizeW(pDllName, nullptr);
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
31 void *pVersionData = HeapAlloc(GetProcessHeap(), 0, uVersionSize);
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
32 {
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
33 GetFileVersionInfoW(pDllName, 0, uVersionSize, pVersionData);
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
34
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
35 VS_FIXEDFILEINFO *pInfo = nullptr;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
36 UINT uInfoSize = 0;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
37 VerQueryValueW(pVersionData, L"\\", (void **)&pInfo, &uInfoSize);
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
38
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
39 if (!pMajor || !pMinor)
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
40 {
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
41 HeapFree(GetProcessHeap(), 0, pVersionData);
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
42 return false;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
43 }
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
44 *pMajor = pInfo->dwFileVersionMS;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
45 *pMinor = pInfo->dwFileVersionLS;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
46 }
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
47 HeapFree(GetProcessHeap(), 0, pVersionData);
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
48 return true;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
49 }
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
50
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
51
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
52 // 3.15.1.0:
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
53 // 3 15 1 0
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
54 // 0x0003000F00010000
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
55 unsigned __int64 uBinkVersion;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
56
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
57
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
58
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
59
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
60
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
62 //----- (004BFE2D) --------------------------------------------------------
13
17150bdf321e исправлено неполное воспроизведение роликов, бинков
Серик@ПончиК
parents: 3
diff changeset
63 _BINKBUF *VideoPlayer::CreateBinkBuffer(HWND hWindow, unsigned int uWidth, unsigned int uHeight, char a4)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
64 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
65 __int32 v4; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
66 _BINKBUF *v5; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
67 HRESULT v6; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
68 IDirectDrawSurface *v7; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
69 HRESULT v8; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
70 char v9; // al@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
71 DDSURFACEDESC2 v11; // [sp+Ch] [bp-108h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
72 DDSURFACEDESC Dst; // [sp+88h] [bp-8Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
73 unsigned int v13; // [sp+F4h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
74 struct tagRECT Rect; // [sp+F8h] [bp-1Ch]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
75 IDirectDrawSurface4 *v15; // [sp+108h] [bp-Ch]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
76 IDirectDrawSurface2 *a2; // [sp+10Ch] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
77 HWND hWnd; // [sp+110h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
79 v13 = uWidth;
13
17150bdf321e исправлено неполное воспроизведение роликов, бинков
Серик@ПончиК
parents: 3
diff changeset
80 hWnd = hWindow;
17150bdf321e исправлено неполное воспроизведение роликов, бинков
Серик@ПончиК
parents: 3
diff changeset
81 if ( pVersion->pVersionInfo.dwPlatformId != VER_PLATFORM_WIN32_NT || pVersion->pVersionInfo.dwMajorVersion >= 5u )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
82 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
83 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
84 v15 = 0;
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
85
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
86 if (uBinkVersion == 0x0001000500150000)
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
87 {
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
88 v5 = new _BINKBUF_1_5_21_0;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
89 memset(v5, 0, sizeof(_BINKBUF_1_5_21_0));
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
90 }
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
91 else if (uBinkVersion == 0x0003000000000000)
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
92 {
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
93 v5 = new _BINKBUF_3_0_0_0;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
94 memset(v5, 0, sizeof(_BINKBUF_3_0_0_0));
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
95 }
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
96
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
97 memset(&v11, 0, 0x7Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
98 v11.dwSize = 124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
99 v11.dwWidth = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
100 v11.dwFlags = 0x1007u; // DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
101 v11.ddsCaps.dwCaps = 0x4040u; // DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
102 v11.dwHeight = uHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
103 *(_QWORD *)&v11.ddpfPixelFormat.dwSize = 0x400000020ui64;// DDPF_FOURCC
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
104 v11.ddpfPixelFormat.dwFourCC = 0x32595559u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
105 if ( dword_6BE384_2dacceloff || pRenderer->pDirectDraw4->CreateSurface(&v11, &v15, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
106 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
107 memset(&v11.ddpfPixelFormat, 0, sizeof(DDPIXELFORMAT));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
109 v11.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
110 v11.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
111
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
112 auto hr = pRenderer->pDirectDraw4->CreateSurface(&v11, &v15, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
113 ErrD3D(hr, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Video.cpp:1476");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
114 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
115 v5->uWidth = v11.dwWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
116 v5->uHeight = v11.dwHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
117 v5->uBinkDDSurfaceType = BinkDDSurfaceType((IDirectDrawSurface *)v15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
118 v5->field_38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
119 v7 = (IDirectDrawSurface *)v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
120 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
121 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
122 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
123 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
124 a2 = 0;
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
125
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
126
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
127 if (uBinkVersion == 0x0001000500150000)
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
128 {
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
129 v5 = new _BINKBUF_1_5_21_0;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
130 memset(v5, 0, sizeof(_BINKBUF_1_5_21_0));
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
131 }
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
132 else if (uBinkVersion == 0x0003000000000000)
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
133 {
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
134 v5 = new _BINKBUF_3_0_0_0;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
135 memset(v5, 0, sizeof(_BINKBUF_3_0_0_0));
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
136 }
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
137
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
138 memset(&Dst, 0, 0x6Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
139 Dst.dwSize = 108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
140 Dst.dwWidth = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
141 Dst.dwFlags = 4103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
142 Dst.ddsCaps.dwCaps = 16448;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
143 Dst.dwHeight = uHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
144 Dst.ddpfPixelFormat.dwSize = 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
145 Dst.ddpfPixelFormat.dwFlags = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
146 Dst.ddpfPixelFormat.dwFourCC = 844715353;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
147 if ( dword_6BE384_2dacceloff
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
148 || pRenderer->pDirectDraw2->CreateSurface(&Dst, (LPDIRECTDRAWSURFACE *)&a2, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
149 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
150 memset(&Dst.ddpfPixelFormat, 0, sizeof(DDPIXELFORMAT));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
152 Dst.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
153 Dst.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
154
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
155 auto hr = pRenderer->pDirectDraw2->CreateSurface(&Dst, (LPDIRECTDRAWSURFACE *)&a2, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
156 ErrD3D(hr, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Video.cpp:1426");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
157 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
158 v5->uWidth = Dst.dwWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
159 v5->uHeight = Dst.dwHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
160 v5->uBinkDDSurfaceType = BinkDDSurfaceType((IDirectDrawSurface *)a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
161 v5->field_38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
162 v7 = (IDirectDrawSurface *)a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
163 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
164 v5->pTargetDDrawSurface = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
165 v5->hWnd = hWnd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
166 v9 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
167 v5->field_4C = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
168 v5->field_68 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
169 v5->field_5C = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
170 v5->field_74 = v9 & 0x1F;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
171 v5->field_78 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
172 v5->field_24 = GetSystemMetrics(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
173 v5->field_28 = GetSystemMetrics(SM_CYSCREEN);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
174 v5->field_2C = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
175 GetWindowRect(hWnd, &Rect);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
176 v5->field_8 = Rect.right - Rect.left;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
177 v5->field_C = Rect.bottom - Rect.top;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
178 v5->field_1C = Rect.left;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
179 v5->field_20 = Rect.top;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
180 Rect.left = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
181 Rect.top = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
182 ClientToScreen(hWnd, (LPPOINT)&Rect);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
183 v5->field_1C = Rect.left - v5->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
184 v5->field_20 = Rect.top - v5->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
185 GetClientRect(hWnd, &Rect);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
186 v5->field_30 = v5->field_8 - Rect.right;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
187 v5->field_34 = v5->field_C - Rect.bottom;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
188 v5->field_8 = v5->uWidth + v5->field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
189 v5->field_C = v5->uHeight + v5->field_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
190 BinkBufferSetOffset(v5, v4, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
191 BinkBufferSetScale(v5, v5->uWidth, v5->uHeight);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
192 return v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
193 }
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
194
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
195
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
196 //----- (004C0133) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
197 bool BinkLockBuffer(_BINKBUF *_this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
198 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
199 _BINKBUF *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
200 IDirectDrawSurface *v2; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
201 DWORD v4; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
202 DWORD v5; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
203 IDirectDrawSurface4 *v6; // edi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
204 LPVOID v7; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
205
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
206 v1 = _this;
13
17150bdf321e исправлено неполное воспроизведение роликов, бинков
Серик@ПончиК
parents: 3
diff changeset
207 if ( pVersion->pVersionInfo.dwPlatformId != VER_PLATFORM_WIN32_NT || pVersion->pVersionInfo.dwMajorVersion >= 5u )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
208 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
209 DDSURFACEDESC2 v8; // [sp+Ch] [bp-7Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
210 if ( _this->pTargetDDrawSurface )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
211 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
212 memset(&v8, 0, 0x7Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
213 v8.dwSize = 124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
214 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
215 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
216 v6 = (IDirectDrawSurface4 *)v1->pTargetDDrawSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
217 if ( !v6->Lock(0, &v8, 1u, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
218 break;
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
219
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
220 if (uBinkVersion < 0x0003000000000000)
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
221 BYTE3(v1->uBinkDDSurfaceType) |= 0x80u;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
222 else
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
223 BYTE3(v1->uBinkDDSurfaceType) |= 0x04;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
224
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
225 if ( v6->Restore() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
226 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
227 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
228 v7 = v8.lpSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
229 v1->pDDrawSurfaceData_ = v8.lpSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
230 v1->pDDrawSurfaceData = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
231 v5 = v8.lPitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
232 goto LABEL_15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
233 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
234 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
235 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
236 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
237 DDSURFACEDESC v8; // [sp+Ch] [bp-7Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
238 if ( _this->pTargetDDrawSurface )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
239 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
240 memset(&v8.lPitch, 0, 0x6Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
241 v8.lPitch = 108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
242 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
243 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
244 v2 = v1->pTargetDDrawSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
245 if ( !v2->Lock(0, (LPDDSURFACEDESC)&v8.lPitch, 1u, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
246 break;
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
247
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
248 if (uBinkVersion < 0x0003000000000000)
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
249 __asm int 3;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
250 else
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
251 BYTE3(v1->uBinkDDSurfaceType) |= 4u;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
252
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
253 if ( v2->Restore() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
254 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
255 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
256 v4 = (DWORD)v8.lpSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
257 v1->pDDrawSurfaceData_ = (void *)v8.lpSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
258 v1->pDDrawSurfaceData = (void *)v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
259 v5 = v8.dwReserved;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
260 LABEL_15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
261 v1->uDDrawSurfacePitch = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
262 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
263 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
264 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
265 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
266 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
267
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
268 //----- (004C01FB) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
269 void BinkUnlockBuffer(_BINKBUF *_this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
270 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
271 _BINKBUF *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
272 IDirectDrawSurface *v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
273
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
274 v1 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
275 v2 = _this->pTargetDDrawSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
276 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
277 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
278 v2->Unlock(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
279 v1->uDDrawSurfacePitch = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
280 v1->pDDrawSurfaceData = 0;
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
281
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
282 if (uBinkVersion < 0x0003000000000000)
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
283 BYTE3(_this->uBinkDDSurfaceType) &= 0x7F;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
284 else
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
285 BYTE3(_this->uBinkDDSurfaceType) &= 0xFB;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
286 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
287 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
288
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
289
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
290
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
291
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
292 //----- (004BF794) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
293 void __cdecl ShowIntroVideo_and_LoadingScreen()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
294 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
295 RGBTexture tex; // [sp+Ch] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
296 unsigned int uTrackStartMS; // [sp+34h] [bp-8h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
297 unsigned int uTrackEndMS; // [sp+38h] [bp-4h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
298
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
299 pVideoPlayer->bStopBeforeSchedule = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
300 pVideoPlayer->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
301 bGameoverLoop = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
302 if ( !bNoVideo )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
303 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
304 bNoVideo = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
305 pRenderer->PresentBlackScreen();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
306 pGame->pCShow->PlayMovie(MOVIE_3DOLogo, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
307 if ( !pVideoPlayer->bStopBeforeSchedule )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
308 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
309 pGame->pCShow->PlayMovie(MOVIE_NWCLogo, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
310 if ( !pVideoPlayer->bStopBeforeSchedule )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
311 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
312 pGame->pCShow->PlayMovie(MOVIE_JVC, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
313 if ( !pVideoPlayer->bStopBeforeSchedule )
13
17150bdf321e исправлено неполное воспроизведение роликов, бинков
Серик@ПончиК
parents: 3
diff changeset
314 pGame->pCShow->PlayMovie(MOVIE_Intro, 1);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
315 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
316 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
317 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
318 tex.Load("mm6title.pcx", 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
319 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
320 pRenderer->DrawTextureRGB(0, 0, &tex);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
321 free(tex.pPixels);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
322 tex.pPixels = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
323 MainMenuUI_LoadFontsAndSomeStuff();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
324 DrawCopyrightWindow();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
325 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
326 pRenderer->Present();
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
327 if (!bNoSound && pAudioPlayer->hAILRedbook )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
328 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
329 pAudioPlayer->SetMusicVolume((signed __int64)(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
330 AIL_redbook_stop(pAudioPlayer->hAILRedbook);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
331 AIL_redbook_track_info(pAudioPlayer->hAILRedbook, 0xEu, &uTrackStartMS, &uTrackEndMS);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
332 AIL_redbook_play(pAudioPlayer->hAILRedbook, uTrackStartMS + 1, uTrackEndMS);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
333 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
334 bGameoverLoop = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
335 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
336
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
337
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
338
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
339
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
340 //----- (004BE70E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
341 void __fastcall VideoPlayer::MovieLoop(const char *pMovieName, int a2, int a3, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
342 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
343 int v4; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
344 const char *v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
345 MSG Msg; // [sp+Ch] [bp-1Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
346
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
347 v4 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
348 v5 = pMovieName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
349 if ( !(dword_6BE364_game_settings_1 & 0x44) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
350 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
351 if ( a2 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
352 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
353 ShowCursor(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
354 pVideoPlayer->OpenMovie(v5, 0, a3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
355 pVideoPlayer->bPlayingMovie = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
356 pVideoPlayer->field_44 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
357 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
358 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
359 pRenderer->ClearTarget(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
360 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
361 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
362 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
363 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
364 pRenderer->ClearTarget(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
365 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
366 }
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 21
diff changeset
367 pCurrentScreen = 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
368 if ( pVideoPlayer->uMovieFormat == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
369 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
370 if ( pVideoPlayer->pBinkMovie )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
371 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
372 pVideoPlayer->BinkDrawFrame(pVideoPlayer->hWindow, v4, a3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
373 while ( pVideoPlayer->pBinkMovie )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
374 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
375 if ( pVideoPlayer->bStopBeforeSchedule )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
376 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
377 while ( PeekMessageA(&Msg, 0, 0, 0, 1u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
378 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
379 if ( Msg.message == 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
380 Game_DeinitializeAndTerminate(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
381 if ( Msg.message == 15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
382 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
383 TranslateMessage(&Msg);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
384 DispatchMessageA(&Msg);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
385 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
386 GUI_MainMenuMessageProc();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
387 if ( !pVideoPlayer->pBinkMovie )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
388 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
389 if ( !BinkWait(pVideoPlayer->pBinkMovie) && !pVideoPlayer->bStopBeforeSchedule )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
390 pVideoPlayer->BinkDrawFrame(pVideoPlayer->hWindow, v4, a3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
391 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
392 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
393 if ( pVideoPlayer->bStopBeforeSchedule == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
394 Sleep(0x3E8u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
395 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
396 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
397 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
398 if ( pVideoPlayer->uMovieFormat == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
399 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
400 if ( pVideoPlayer->pSmackerMovie )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
401 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
402 pVideoPlayer->SmackDrawFrame(pVideoPlayer->hWindow, v4, a3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
403 while ( pVideoPlayer->pSmackerMovie )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
404 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
405 if ( pVideoPlayer->bStopBeforeSchedule )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
406 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
407 while ( PeekMessageW(&Msg, 0, 0, 0, 1u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
408 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
409 if (Msg.message == WM_QUIT)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
410 Game_DeinitializeAndTerminate(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
411 if (Msg.message == WM_PAINT)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
412 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
413 TranslateMessage(&Msg);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
414 DispatchMessageW(&Msg);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
415 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
416 GUI_MainMenuMessageProc();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
417 if ( !pVideoPlayer->pSmackerMovie )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
418 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
419 if ( !SmackWait(pVideoPlayer->pSmackerMovie) && !pVideoPlayer->bStopBeforeSchedule )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
420 pVideoPlayer->SmackDrawFrame(pVideoPlayer->hWindow, v4, a3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
421 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
422 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
423 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
424 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
425 if ( a4 == 1 )
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 21
diff changeset
426 pCurrentScreen = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
427 pVideoPlayer->bPlayingMovie = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
428 ShowCursor(1);
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 21
diff changeset
429 if ( pCurrentScreen == 16 )
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 21
diff changeset
430 pCurrentScreen = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
431 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
432 }
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
433
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
434
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
435
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
436
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
437 //----- (004BE95A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
438 unsigned int VideoPlayer::SmackCheckSurfaceFromat()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
439 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
440 DDPIXELFORMAT a2; // [sp+0h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
441
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
442 a2.dwSize = 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
443 a2.dwFlags = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
444 pRenderer->GetTargetPixelFormat(&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
445 if ( a2.dwRGBBitCount != 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
446 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
447 if ( a2.dwRBitMask == 0xF800 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
448 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
449 if ( a2.dwGBitMask == 0x7E0 && a2.dwBBitMask == 0x1F )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
450 return 0xC0000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
451 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
452 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
453 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
454 if ( a2.dwRBitMask == 0x7C00
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
455 && a2.dwGBitMask == 0x3E0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
456 && a2.dwBBitMask == 0x1F )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
457 return 0x80000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
458 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
459 MessageBoxA(0, "Unsupported pixel format.", "Smacker Error", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
460 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
461 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
462 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
463
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
464 //----- (004BE9D8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
465 void VideoPlayer::Initialize()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
466 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
467 //VideoPlayer *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
468 HANDLE v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
469 char *v3; // ebp@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
470 HANDLE v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
471 HANDLE v5; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
472 unsigned int v6; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
473 const char *v7; // [sp-8h] [bp-1Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
474 char *v8; // [sp-4h] [bp-18h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
475 DWORD NumberOfBytesRead; // [sp+10h] [bp-4h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
476
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
477
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
478 uint uBinkVersionMajor = -1,
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
479 uBinkVersionMinor = -1;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
480 GetDllVersion(L"BINKW32.DLL", &uBinkVersionMajor, &uBinkVersionMinor);
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
481 uBinkVersion = (unsigned __int64)uBinkVersionMajor << 32 | uBinkVersionMinor;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
482
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
483
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
484 //v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
485 strcpy(pTmpBuf, "anims\\might7.vid");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
486 v2 = CreateFileW(L"anims\\might7.vid", GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0x8000080u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
487 hMightVid = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
488 if ( v2 == INVALID_HANDLE_VALUE )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
489 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
490 v8 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
491 v3 = pTmpBuf2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
492 LABEL_3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
493 v7 = "Can't open file - anims\\%s.smk";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
494 LABEL_4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
495 sprintfex(v3, v7, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
496 MessageBoxA(0, v3, "Video File Error", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
497 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
498 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
499 strcpy(pTmpBuf, "anims\\magic7.vid");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
500 v4 = CreateFileW(L"anims\\magic7.vid", GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0x8000080u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
501 hMagicVid = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
502 if ( v4 == INVALID_HANDLE_VALUE )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
503 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
504 v3 = pTmpBuf2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
505 v8 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
506 if ( !bCanLoadFromCD )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
507 goto LABEL_3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
508 sprintfex(pTmpBuf2, "%c:\\%s", (unsigned __int8)cMM7GameCDDriveLetter, pTmpBuf);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
509 v5 = CreateFileA(pTmpBuf2, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0x8000080u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
510 hMagicVid = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
511 if ( v5 == (HANDLE)INVALID_HANDLE_VALUE )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
512 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
513 v8 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
514 v7 = "Can't open file - %s";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
515 goto LABEL_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
516 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
517 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
518 ReadFile(hMightVid, &uNumMightVideoHeaders, 4u, &NumberOfBytesRead, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
519 ReadFile(hMagicVid, &uNumMagicVideoHeaders, 4u, &NumberOfBytesRead, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
520 v6 = 44 * uNumMightVideoHeaders + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
521 pMagicVideoHeaders = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
522 pMightVideoHeaders = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
523 pMightVideoHeaders = (MovieHeader *)pAllocator->AllocNamedChunk(0, v6, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
524 pMagicVideoHeaders = (MovieHeader *)pAllocator->AllocNamedChunk(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
525 pMagicVideoHeaders,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
526 44 * uNumMagicVideoHeaders + 2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
527 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
528 ReadFile(hMightVid, pMightVideoHeaders, 44 * uNumMightVideoHeaders, &NumberOfBytesRead, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
529 ReadFile(hMagicVid, pMagicVideoHeaders, 44 * uNumMagicVideoHeaders, &NumberOfBytesRead, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
530 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
531
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
532 //----- (004BEB41) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
533 void VideoPlayer::Prepare()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
534 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
535 VideoPlayer *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
536 IDirectDrawSurface *v2; // [sp-4h] [bp-Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
537
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
538 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
539 pEventTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
540 v1->bStopBeforeSchedule = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
541 if ( pAudioPlayer->hAILRedbook )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
542 AIL_redbook_pause(pAudioPlayer->hAILRedbook);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
543 v1->field_54 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
544 v1->hWindow = hWnd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
545 v1->pSmackerMovie = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
546 v1->pSmackerBuffer = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
547 v1->pBinkMovie = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
548 v1->pBinkBuffer = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
549 v1->bPlayingMovie = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
550 v1->bFirstFrame = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
551 v1->bUsingSmackerMMX = SmackUseMMX(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
552 BinkSetSoundSystem(BinkOpenMiles, pAudioPlayer->hDigDriver);
13
17150bdf321e исправлено неполное воспроизведение роликов, бинков
Серик@ПончиК
parents: 3
diff changeset
553 if ( pVersion->pVersionInfo.dwPlatformId != VER_PLATFORM_WIN32_NT || pVersion->pVersionInfo.dwMajorVersion >= 5u )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
554 v2 = (IDirectDrawSurface*)pRenderer->pBackBuffer4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
555 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
556 v2 = (IDirectDrawSurface*)pRenderer->pBackBuffer2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
557 v1->uBinkDirectDrawSurfaceType = BinkDDSurfaceType(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
558 _flushall();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
559 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
560
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
561
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
562 //----- (004BEBD7) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
563 void VideoPlayer::Unload()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
564 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
565 VideoPlayer *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
566 _BINK *v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
567 _BINKBUF *v3; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
568 _SMACK *v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
569
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
570 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
571 v2 = this->pBinkMovie;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
572 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
573 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
574 BinkPause(v2, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
575 Sleep(300u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
576 BinkClose(v1->pBinkMovie);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
577 v1->pBinkMovie = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
578 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
579 v3 = v1->pBinkBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
580 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
581 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
582 v3->pTargetDDrawSurface->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
583 v1->pBinkBuffer->pTargetDDrawSurface = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
584 free(v1->pBinkBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
585 v1->pBinkBuffer = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
586 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
587 v4 = v1->pSmackerMovie;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
588 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
589 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
590 SmackSoundOnOff(v4, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
591 SmackClose(v1->pSmackerMovie);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
592 v1->pSmackerMovie = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
593 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
594 if ( v1->pSmackerBuffer )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
595 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
596 SmackBufferClose(v1->pSmackerBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
597 v1->pSmackerBuffer = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
598 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
599 if ( v1->pSmackMovieBlit )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
600 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
601 SmackBlitClose(v1->pSmackMovieBlit);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
602 v1->pSmackMovieBlit = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
603 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
604 v1->field_54 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
605 v1->uMovieFormat = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
606 v1->dword_0000A0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
607 memset(v1->pCurrentMovieName, 0, 0x40u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
608 if ( pAudioPlayer->hAILRedbook && !bGameoverLoop )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
609 AIL_redbook_resume(pAudioPlayer->hAILRedbook);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
610 pEventTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
611 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
612
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
613 //----- (004BECD5) --------------------------------------------------------
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
614 void VideoPlayer::FastForwardToFrame(unsigned int uDstFrameNum)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
615 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
616 VideoPlayer *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
617 unsigned int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
618
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
619 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
620 v3 = this->uMovieFormat;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
621 if ( v3 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
622 {
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
623 if (uDstFrameNum)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
624 {
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
625 int *pCurrentFrame = uBinkVersion == 0x0001000500150000 ? &((_BINK_1_5_21_0 *)pBinkMovie)->uCurrentFrame :
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
626 uBinkVersion == 0x0003000000000000 ? &((_BINK_3_0_0_0 *)pBinkMovie)->uCurrentFrame :
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
627 nullptr;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
628 while (*pCurrentFrame < uDstFrameNum)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
629 {
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
630 BinkDoFrame(pBinkMovie);
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
631 BinkNextFrame(pBinkMovie);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
632 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
633 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
634 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
635 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
636 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
637 if ( v3 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
638 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
639 SmackSoundOnOff(this->pSmackerMovie, 0);
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
640 if (uDstFrameNum)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
641 {
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
642 while ( v2->pSmackerMovie->FrameNum < uDstFrameNum)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
643 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
644 SmackDoFrame(v2->pSmackerMovie);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
645 SmackNextFrame(v2->pSmackerMovie);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
646 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
647 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
648 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
649 Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
650 }
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
651
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
652
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
653 //----- (004BED4F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
654 void VideoPlayer::BinkDrawFrame(HWND hWnd, int a3, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
655 {
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
656 //VideoPlayer *v4; // esi@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
657 _BINKBUF *v5; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
658 LONG v6; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
659 int v7; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
660 LONG v8; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
661 struct tagRECT a3a; // [sp+8h] [bp-20h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
662 struct tagRECT a1; // [sp+18h] [bp-10h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
663
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
664 //v4 = this;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
665 if ( this->pBinkMovie && this->pBinkBuffer )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
666 {
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
667 BinkDoFrame(pBinkMovie);
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
668 BinkGetRects(pBinkMovie, pBinkBuffer->uBinkDDSurfaceType);
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
669 if ( BinkLockBuffer(pBinkBuffer) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
670 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
671 BinkCopyToBuffer(
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
672 pBinkMovie,
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
673 pBinkBuffer->pDDrawSurfaceData,
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
674 pBinkBuffer->uDDrawSurfacePitch,
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
675 pBinkBuffer->uHeight,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
676 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
677 0,
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
678 pBinkBuffer->uBinkDDSurfaceType);
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
679 BinkUnlockBuffer(pBinkBuffer);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
680 }
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
681 v5 = pBinkBuffer;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
682 if ( pRenderer->bWindowMode )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
683 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
684 v6 = v5->uRectX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
685 a1.left = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
686 a1.top = v5->uRectY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
687 v7 = v6 + v5->uWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
688 a1.right = v6 + v5->uWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
689 v8 = a1.top + v5->uHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
690 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
691 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
692 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
693 a1.left = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
694 a1.top = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
695 v7 = v5->uWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
696 a1.right = v5->uWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
697 v8 = v5->uHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
698 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
699 a1.bottom = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
700 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
701 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
702 a1.right = v5->uWidth + v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
703 a1.bottom = v5->uHeight + v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
704 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
705 a3a.left = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
706 a3a.top = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
707 a3a.right = v5->uWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
708 a3a.bottom = v5->uHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
709 pRenderer->BltToFront(&a1, v5->pTargetDDrawSurface, &a3a, 0x1000000u);
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
710
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
711
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
712 int *pCurrentFrame = uBinkVersion == 0x0001000500150000 ? &((_BINK_1_5_21_0 *)pBinkMovie)->uCurrentFrame :
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
713 uBinkVersion == 0x0003000000000000 ? &((_BINK_3_0_0_0 *)pBinkMovie)->uCurrentFrame:
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
714 nullptr;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
715 int *pNumFrames = uBinkVersion == 0x0001000500150000 ? &((_BINK_1_5_21_0 *)pBinkMovie)->uNumFrames :
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
716 uBinkVersion == 0x0003000000000000 ? &((_BINK_3_0_0_0 *)pBinkMovie)->uNumFrames :
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
717 nullptr;
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
718
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
719 if (*pCurrentFrame != *pNumFrames - 1 || bLoopPlaying)
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
720 BinkNextFrame(pBinkMovie);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
721 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
722 Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
723 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
724 }
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
725
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
726
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
727
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
728 //----- (004BEE6B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
729 void VideoPlayer::SmackDrawFrame(HWND hWnd, int a3, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
730 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
731 VideoPlayer *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
732 _SMACK *v5; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
733 unsigned int v6; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
734 char v7; // zf@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
735 int v8; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
736 _SMACK *v9; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
737 _SMACK *v10; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
738 _SMACK *v11; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
739 unsigned int v12; // [sp-1Ch] [bp-34h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
740 LONG v13; // [sp-18h] [bp-30h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
741 LONG v14; // [sp-14h] [bp-2Ch]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
742 signed int v15; // [sp-10h] [bp-28h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
743 signed int v16; // [sp-Ch] [bp-24h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
744 signed int v17; // [sp-8h] [bp-20h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
745 struct tagPOINT Point; // [sp+8h] [bp-10h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
746 unsigned short *pOutSurface; // [sp+10h] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
747 unsigned int uPixelsPerRow; // [sp+14h] [bp-4h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
748
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
749 v4 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
750 if ( !pRenderer->bWindowMode || GetFocus() == hWnd )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
751 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
752 v5 = v4->pSmackerMovie;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
753 if ( v5->NewPalette )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
754 SmackBlitSetPalette(v4->pSmackMovieBlit, v5->Palette, v5->PalType);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
755 SmackDoFrame(v4->pSmackerMovie);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
756 pRenderer->LockFrontBuffer((void **)&pOutSurface, &uPixelsPerRow);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
757 v6 = 2 * uPixelsPerRow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
758 v7 = v4->bFirstFrame == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
759 uPixelsPerRow *= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
760 if ( !v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
761 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
762 if ( pRenderer->bWindowMode )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
763 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
764 Point.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
765 Point.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
766 ClientToScreen(hWnd, &Point);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
767 v17 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
768 v16 = 480;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
769 v15 = 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
770 v14 = Point.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
771 v13 = Point.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
772 v12 = uPixelsPerRow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
773 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
774 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
775 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
776 v17 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
777 v16 = 480;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
778 v15 = 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
779 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
780 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
781 v12 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
782 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
783 SmackBlitClear(v4->pSmackMovieBlit, pOutSurface, v12, v13, v14, v15, v16, v17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
784 v4->bFirstFrame = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
785 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
786 pRenderer->RestoreFrontBuffer();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
787 if ( pRenderer->bWindowMode )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
788 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
789 Point.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
790 Point.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
791 ClientToScreen(hWnd, &Point);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
792 v8 = SmackToBufferRect(v4->pSmackerMovie, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
793 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
794 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
795 while ( v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
796 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
797 v9 = v4->pSmackerMovie;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
798 SmackBlit(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
799 v4->pSmackMovieBlit,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
800 pOutSurface,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
801 uPixelsPerRow,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
802 v9->LastRectx + Point.x / 2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
803 a3 + v9->LastRecty + Point.y / 2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
804 v4->pSomeSmackerBuffer,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
805 v9->Width,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
806 v9->LastRectx,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
807 v9->LastRecty,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
808 v9->LastRectw,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
809 v9->LastRecth);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
810 v8 = SmackToBufferRect(v4->pSmackerMovie, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
811 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
812 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
813 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
814 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
815 while ( v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
816 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
817 v10 = v4->pSmackerMovie;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
818 SmackBlit(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
819 v4->pSmackMovieBlit,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
820 pOutSurface,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
821 uPixelsPerRow,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
822 Point.x + v10->LastRectx,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
823 a3 + Point.y + v10->LastRecty,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
824 v4->pSomeSmackerBuffer,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
825 v10->Width,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
826 v10->LastRectx,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
827 v10->LastRecty,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
828 v10->LastRectw,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
829 v10->LastRecth);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
830 v8 = SmackToBufferRect(v4->pSmackerMovie, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
831 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
832 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
833 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
834 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
835 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
836 while ( SmackToBufferRect(v4->pSmackerMovie, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
837 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
838 v11 = v4->pSmackerMovie;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
839 SmackBlit(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
840 v4->pSmackMovieBlit,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
841 pOutSurface,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
842 uPixelsPerRow,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
843 v11->LastRectx,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
844 a3 + v11->LastRecty,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
845 v4->pSomeSmackerBuffer,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
846 v11->Width,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
847 v11->LastRectx,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
848 v11->LastRecty,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
849 v11->LastRectw,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
850 v11->LastRecth);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
851 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
852 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
853 pRenderer->UnlockFrontBuffer();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
854 if ( v4->pSmackerMovie->FrameNum != v4->pSmackerMovie->Frames - 1 || v4->bLoopPlaying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
855 SmackNextFrame(v4->pSmackerMovie);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
856 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
857 Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
858 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
859 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
860 // 4D83D8: using guessed type int __stdcall SmackBlitSetPalette(int, int, int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
861 // 4D83DC: using guessed type int __stdcall SmackBlitClear(int, int, int, int, int, int, int, int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
862 // 4D83E0: using guessed type int __stdcall SmackToBufferRect(int, int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
863 // 4D83E4: using guessed type int __stdcall SmackDoFrame(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
864 // 4D83E8: using guessed type int __stdcall SmackNextFrame(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
865 // 4D8404: using guessed type int __stdcall SmackBlit(int, int, int, int, int, int, int, int, int, int, int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
866
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
867 //----- (004BF08B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
868 void VideoPlayer::SmackUpdatePalette(HWND hWnd)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
869 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
870 VideoPlayer *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
871 unsigned __int16 *v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
872 unsigned int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
873 unsigned int v5; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
874 _SMACK *v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
875
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
876 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
877 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
878 v3 = pRenderer->pTargetSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
879 v4 = pRenderer->uTargetSurfacePitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
880 v5 = SmackCheckSurfaceFromat();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
881 SmackToBuffer(v2->pSmackerMovie, 8, 8, 2 * v4, pRenderer->field_14, v3, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
882 v6 = v2->pSmackerMovie;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
883 if ( v6->NewPalette )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
884 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
885 SmackBufferNewPalette((long)pSmackerBuffer, (long)v6->Palette, LOWORD(v6->PalType));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
886 SmackColorRemapWithTrans(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
887 (long)pSmackerMovie,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
888 (long)pSmackerBuffer->Palette,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
889 (long)pSmackerBuffer->MaxPalColors,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
890 (long)pSmackerBuffer->PalType,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
891 1000);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
892 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
893 SmackDoFrame(v2->pSmackerMovie);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
894 if ( v2->pSmackerMovie->FrameNum != v2->pSmackerMovie->Frames - 1 || v2->bLoopPlaying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
895 SmackNextFrame(v2->pSmackerMovie);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
896 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
897 Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
898 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
899 }
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
900
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
901
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
902
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
903
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
904
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
905 //----- (004BF141) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
906 _BINK *VideoPlayer::OpenBink(const char *pName)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
907 {
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
908 //VideoPlayer *v2; // esi@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
909 signed int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
910 int v4; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
911 signed int v5; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
912 int v6; // ebx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
913 HANDLE v8; // [sp-8h] [bp-18h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
914 unsigned int v9; // [sp-4h] [bp-14h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
915
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
916 for (uint i = 0; i < uNumMightVideoHeaders; ++i)
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
917 if (!strcmpi(pName, pMightVideoHeaders[i].pVideoName))
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
918 {
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
919 SetFilePointer(hMightVid, pMightVideoHeaders[i].uFileOffset, 0, FILE_BEGIN);
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
920
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
921 if (uBinkVersion < 0x0003000000000000)
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
922 return BinkOpen(hMightVid, 0x08800000);
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
923 else
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
924 return BinkOpen(hMightVid, 0x82000000);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
925 }
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
926
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
927 for (uint i = 0; i < uNumMagicVideoHeaders; ++i)
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
928 if (!strcmpi(pName, pMagicVideoHeaders[i].pVideoName))
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
929 {
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
930 SetFilePointer(hMagicVid, pMagicVideoHeaders[i].uFileOffset, 0, FILE_BEGIN);
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
931
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
932 if (uBinkVersion < 0x0003000000000000)
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
933 return BinkOpen(hMagicVid, 0x08800000);
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
934 else
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
935 return BinkOpen(hMagicVid, 0x82000000);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
936 }
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
937
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
938 return nullptr;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
939 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
940
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
941 //----- (004BF1E6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
942 _SMACK *VideoPlayer::OpenSmack(const char *pFilename)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
943 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
944 VideoPlayer *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
945 signed int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
946 int v4; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
947 signed int v5; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
948 int v6; // ebx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
949 HANDLE v8; // [sp-Ch] [bp-1Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
950 unsigned int v9; // [sp-8h] [bp-18h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
951 signed int v10; // [sp-4h] [bp-14h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
952
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
953 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
954 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
955 if ( (signed int)this->uNumMightVideoHeaders > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
956 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
957 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
958 while ( _strcmpi(v2->pMightVideoHeaders[v4].pVideoName, pFilename) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
959 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
960 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
961 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
962 if ( v3 >= (signed int)v2->uNumMightVideoHeaders )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
963 goto LABEL_5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
964 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
965 SetFilePointer(v2->hMightVid, v2->pMightVideoHeaders[v3].uFileOffset, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
966 v10 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
967 v9 = 0x7140u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
968 v8 = v2->hMightVid;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
969 return SmackOpen(v8, v9, v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
970 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
971 LABEL_5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
972 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
973 if ( (signed int)v2->uNumMagicVideoHeaders > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
974 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
975 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
976 while ( _strcmpi(v2->pMagicVideoHeaders[v6].pVideoName, pFilename) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
977 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
978 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
979 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
980 if ( v5 >= (signed int)v2->uNumMagicVideoHeaders )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
981 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
982 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
983 SetFilePointer(v2->hMagicVid, v2->pMagicVideoHeaders[v5].uFileOffset, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
984 v10 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
985 v9 = 0x7140u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
986 v8 = v2->hMagicVid;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
987 return SmackOpen(v8, v9, v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
988 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
989 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
990 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
991
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
992 //----- (004BF28F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
993 void VideoPlayer::_4BF28F(const char *pMovieName, unsigned int a3_1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
994 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
995 VideoPlayer *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
996 std::string *v4; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
997 _SMACK *v5; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
998 _SMACK *v6; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
999 int v7; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1000 int v8; // ecx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1001 unsigned int v9; // ebx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1002 unsigned int v10; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1003 signed __int64 v11; // qax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1004 char *v12; // [sp-20h] [bp-54h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1005 int v13; // [sp-1Ch] [bp-50h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1006 std::string v14; // [sp-18h] [bp-4Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1007 const char *v15; // [sp-8h] [bp-3Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1008 int v16; // [sp-4h] [bp-38h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1009 char Str2[0x30]; // [sp+Ch] [bp-28h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1010 std::string *v18; // [sp+3Ch] [bp+8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1011 std::string *v19; // [sp+3Ch] [bp+8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1012 unsigned __int16 *v20; // [sp+3Ch] [bp+8h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1013
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1014 v3 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1015 if ( !this->field_54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1016 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1017 Prepare();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1018 v3->bLoopPlaying = a3_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1019 __debugbreak(); // VideoPlayer is larger than this
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1020 if ( v3[1].pVideoFrame.pName[0] == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1021 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1022 v15 = "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Video.cpp:925";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1023 v12 = "Unsupported Bink playback!";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1024 LABEL_6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1025 MessageBoxA(nullptr, v12, v15, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1026 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1027 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1028 sprintfex(Str2, "%s.smk", pMovieName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1029 v5 = OpenSmack(Str2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1030 v3->pSmackerMovie = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1031 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1032 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1033 v3->Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1034 sprintfex(pTmpBuf, "Can't load %s", &Str2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1035 v15 = "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Video.cpp:937";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1036 v12 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1037 goto LABEL_6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1038 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1039 v16 = (int)pMovieName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1040 v3->uMovieFormat = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1041 strcpy(v3->pCurrentMovieName, (const char *)v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1042 v6 = v3->pSmackerMovie;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1043 v3->dword_0000A0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1044 v7 = SmackBufferOpen(v3->hWindow, 4, LOWORD(v6->Width), LOWORD(v6->Height), LOWORD(v6->Width), LOWORD(v6->Height));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1045 v3->pSmackerBuffer = (_SMACKBUF *)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1046 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1047 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1048 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1049 v9 = pRenderer->uTargetSurfacePitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1050 v20 = pRenderer->pTargetSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1051 v10 = SmackCheckSurfaceFromat();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1052 SmackToBuffer(v3->pSmackerMovie, 8, 8, 2 * v9, pRenderer->field_14, v20, v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1053 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1054 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1055 v16 = 32767;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1056 v11 = (signed __int64)(pSoundVolumeLevels[(char)uSoundVolumeMultiplier] * 32767.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1057 SmackVolumePan(v8, HIDWORD(v11), v3->pSmackerMovie, 1040384, v11, 32767);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1058 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1059 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1060
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1061
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1062 //----- (004BF3F9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1063 bool VideoPlayer::AnyMovieLoaded()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1064 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1065 return pSmackerMovie || pBinkMovie;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1066 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1067
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1068 //----- (004BF411) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1069 void VideoPlayer::OpenMovie(const char *pFilename, unsigned int bLoop, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1070 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1071 VideoPlayer *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1072 _BINK *v5; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1073 _SMACK *v6; // eax@3
13
17150bdf321e исправлено неполное воспроизведение роликов, бинков
Серик@ПончиК
parents: 3
diff changeset
1074 _BINK *pBinkMovie; // eax@5
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1075 _SMACK *v8; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1076 char *v9; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1077 unsigned int v10; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1078 _SMACKBLIT *v11; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1079 const char *v12; // [sp-4h] [bp-38h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1080 char pVideoName[120]; // [sp+Ch] [bp-28h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1081
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1082 v4 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1083 if ( !this->field_54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1084 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1085 Prepare();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1086 v4->bLoopPlaying = bLoop;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1087 sprintf(pVideoName, "%s.bik", pFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1088 v5 = OpenBink(pVideoName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1089 v4->pBinkMovie = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1090 if ( v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1091 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1092 v4->uMovieFormat = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1093 strcpy(v4->pCurrentMovieName, pFilename);
13
17150bdf321e исправлено неполное воспроизведение роликов, бинков
Серик@ПончиК
parents: 3
diff changeset
1094 pBinkMovie = v4->pBinkMovie;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1095 v4->dword_0000A0 = 1;
13
17150bdf321e исправлено неполное воспроизведение роликов, бинков
Серик@ПончиК
parents: 3
diff changeset
1096 if ( pBinkMovie )
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
1097 v4->pBinkBuffer = CreateBinkBuffer(v4->hWindow, pBinkMovie->uWidth, pBinkMovie->uHeight, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1098 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1099 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1100 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1101 Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1102 sprintf(pVideoName, "%s.smk", pFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1103 v6 = OpenSmack(pVideoName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1104 v4->pSmackerMovie = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1105 if ( !v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1106 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1107 Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1108 sprintfex(pVideoName, "Can't load file - anims\\%s.smk", pFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1109 LABEL_17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1110 MessageBoxA(0, pVideoName, "Smacker Error", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1111 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1112 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1113 v4->uMovieFormat = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1114 strcpy(v4->pCurrentMovieName, pFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1115 v8 = v4->pSmackerMovie;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1116 v4->dword_0000A0 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1117 v9 = (char *)malloc(v8->Width * v8->Height);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1118 v4->pSomeSmackerBuffer = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1119 if ( !v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1120 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1121 Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1122 v12 = "Can't allocate memory for buffer";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1123 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1124 sprintfex(pVideoName, v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1125 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1126 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1127 SmackToBuffer(v4->pSmackerMovie, 0, 0, v4->pSmackerMovie->Width, v4->pSmackerMovie->Height, v9, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1128 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1129 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1130 if ( (unsigned int)uCPUSpeed < 165 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1131 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1132 v10 = SmackCheckSurfaceFromat() | 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1133 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1134 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1135 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1136 v10 = SmackCheckSurfaceFromat();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1137 LOBYTE(v10) = v10 | 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1138 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1139 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1140 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1141 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1142 v10 = SmackCheckSurfaceFromat();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1143 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1144 v11 = SmackBlitOpen(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1145 v4->pSmackMovieBlit = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1146 if ( !v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1147 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1148 Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1149 v12 = "Failed to open Blit API";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1150 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1151 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1152 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1153 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1154 }
21
3fa5d0522f92 Both Bink 1.5.21.0 & 3.0.0.0 support added
Nomad
parents: 13
diff changeset
1155
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1156
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1157 //----- (004BF5B2) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1158 void VideoPlayer::_4BF5B2()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1159 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1160 VideoPlayer *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1161 unsigned int v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1162 _BINK **v3; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1163
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1164 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1165 v2 = this->uMovieFormat;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1166 if ( v2 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1167 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1168 v3 = &this->pBinkMovie;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1169 BinkGoto(pBinkMovie, 1, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1170 BinkDoFrame(pBinkMovie);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1171 BinkNextFrame(pBinkMovie);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1172 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1173 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1174 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1175 if ( v2 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1176 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1177 SmackGoto(pSmackerMovie, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1178 if ( pVersion->pVersionInfo.dwPlatformId != VER_PLATFORM_WIN32_NT || pVersion->pVersionInfo.dwMajorVersion != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1179 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1180 SmackDoFrame(pSmackerMovie);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1181 SmackNextFrame(pSmackerMovie);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1182 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1183 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1184 pMouse->_469E24();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1185 if ( ptr_507BC0 && ptr_507BC0->ptr_1C == (void *)165 && !v1->pSmackerMovie )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1186 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1187 bGameoverLoop = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1188 sub_4BD8B5();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1189 ptr_507BC0->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1190 pParty->uFlags &= 0xFFFFFFFDu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1191 if ( EnterHouse((enum HOUSE_TYPE)165) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1192 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1193 pAudioPlayer->PlaySound(SOUND_0, 0, 0, -1, 0, 0, 0, 0);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 0
diff changeset
1194 ptr_507BC0 = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, 165, 0);
59
5159d2e6f559 BLV render
Nomad
parents: 44
diff changeset
1195 ptr_507BC0->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0);
5159d2e6f559 BLV render
Nomad
parents: 44
diff changeset
1196 ptr_507BC0->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0);
5159d2e6f559 BLV render
Nomad
parents: 44
diff changeset
1197 ptr_507BC0->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0);
5159d2e6f559 BLV render
Nomad
parents: 44
diff changeset
1198 ptr_507BC0->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1199 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1200 bGameoverLoop = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1201 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1202 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1204 //----- (004BF73A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1205 void VideoPlayer::_4BF73A()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1206 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1207 VideoPlayer *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1208 int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1209 unsigned __int8 v3; // bl@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1210 int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1211 char Source[32]; // [sp+Ch] [bp-40h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1212
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1213 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1214 v2 = this->dword_0000A0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1215 v3 = LOBYTE(this->bLoopPlaying);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1216 strcpy(Source, this->pCurrentMovieName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1217 Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1218 v4 = v2 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1219 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1220 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1221 if ( v4 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1222 OpenMovie(Source, v3, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1223 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1224 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1225 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1226 _4BF28F(Source, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1227 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1228 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1229
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1230 //----- (004BF8F6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1231 void VideoPlayer::PlayDeathMovie()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1232 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1233 bStopBeforeSchedule = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1234 field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1235 pGame->pCShow->PlayMovie(MOVIE_Death, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1236 }