Skip to content

Commit 62382a4

Browse files
committed
Play win and loss movies in multiplayer
1 parent 0a72f65 commit 62382a4

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed

inc/TiberianSun.inc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,13 @@ cextern _sprintf
298298
cextern stristr_
299299
cextern strcpy
300300

301+
; VQA
302+
cextern Play_Movie
303+
cextern Play_Movie_VQType
304+
cextern Play_Ingame_Movie
305+
cextern VQA_Windows_Message_Loop
306+
307+
301308
; Mumble
302309
cextern initMumble
303310
cextern updateMumble

src/multiplayer_movies.asm

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,53 @@ cextern PlayMoviesInMultiplayer
1212
sint NextNetworkRefreshTime, 0
1313
gbool NetworkRefreshStarted, false
1414

15+
16+
; Display lose movies in multiplayer.
17+
hack 0x005DCDB7
18+
cmp byte [PlayMoviesInMultiplayer], 0
19+
je .Normal_Code
20+
21+
; allow skipping the movie, network communication isn't relevant at this stage anymore
22+
mov byte [PlayMoviesInMultiplayer], 0
23+
24+
push 1
25+
push 1
26+
or edx, 0xFFFFFFFF
27+
mov ecx, [Scen]
28+
mov ecx, [ecx+93Ch] ; ScenarioClass.LoseMovie
29+
call Play_Movie_VQType
30+
31+
.Normal_Code:
32+
mov ecx, [WWMouseClas_Mouse]
33+
mov byte [GameActive], 0
34+
mov eax, [ecx] ; vtable
35+
call [eax+10h] ; virtual call for Show_Mouse
36+
jmp 0x005DCDC8
37+
38+
39+
; Display win movies in multiplayer.
40+
hack 0x005DC9F9
41+
cmp byte [PlayMoviesInMultiplayer], 0
42+
je .Normal_Code
43+
44+
; allow skipping the movie, network communication isn't relevant at this stage anymore
45+
mov byte [PlayMoviesInMultiplayer], 0
46+
47+
push 1
48+
push 1
49+
or edx, 0xFFFFFFFF
50+
mov ecx, [Scen]
51+
mov ecx, [ecx+938h] ; ScenarioClass.WinMovie
52+
call Play_Movie_VQType
53+
54+
.Normal_Code:
55+
mov ecx, [WWMouseClas_Mouse]
56+
mov byte [GameActive], 0
57+
mov eax, [ecx] ; vtable
58+
call [eax+10h] ; virtual call for Show_Mouse
59+
jmp 0x005DCA0B
60+
61+
1562
; Players skipping movies in multiplayer leads to disconnects.
1663
; Prevent players from skipping movies in MP.
1764
hack 0x0066BB61

sym.asm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,7 @@ setcglob 0x0048C140, DSurface_Conversion_Type
510510
setcglob 0x0069FAE0, Write_PCX_File
511511

512512
setcglob 0x00563670, Play_Movie
513+
setcglob 0x005639A0, Play_Movie_VQType
513514
setcglob 0x00563B00, Play_Ingame_Movie
514515
setcglob 0x0066B230, VQA_Windows_Message_Loop
515516

0 commit comments

Comments
 (0)