mirror of
https://github.com/LostArtefacts/TRX.git
synced 2025-04-28 12:47:58 +03:00
parent
6ce4fc4d6f
commit
fb21aeddd6
13 changed files with 452 additions and 232 deletions
|
@ -1,13 +1,15 @@
|
|||
## [Unreleased](https://github.com/LostArtefacts/TRX/compare/tr2-0.5...develop) - ××××-××-××
|
||||
- fixed `/give` not working with weapons (regression from 0.5)
|
||||
- fixed the camera being cut off after using the gong hammer in Ice Palace (#1580)
|
||||
- fixed the audio not being in sync when Lara strikes the gong in Ice Palace (#1725)
|
||||
- improved FMV mode appearance - removed black scanlines (#1729)
|
||||
- improved FMV mode behavior - stopped switching screen resolutions (#1729)
|
||||
- improved switch object names
|
||||
- Switch Type 1 renamed to "Airlock Switch"
|
||||
- Switch Type 2 renamed to "Small Switch"
|
||||
- Switch Type 3 renamed to "Switch Button"
|
||||
- Switch Type 4 renamed to "Lever/Switch"
|
||||
- Switch Type 5 renamed to "Underwater Lever/Switch"
|
||||
- fixed `/give` not working with weapons (regression from 0.5)
|
||||
- fixed the camera being cut off after using the gong hammer in Ice Palace (#1580)
|
||||
- fixed the audio not being in sync when Lara strikes the gong in Ice Palace (#1725)
|
||||
|
||||
## [0.5](https://github.com/LostArtefacts/TRX/compare/afaf12a...tr2-0.5) - 2024-10-08
|
||||
- added `/sfx` command
|
||||
|
|
|
@ -69,10 +69,10 @@
|
|||
</g>
|
||||
<g transform="translate(0 116)">
|
||||
<text x="0" y="7.50">Tomb2.exe progress according to the physical function order:</text>
|
||||
<text class="todo" style="font-size: 12px; " x="747" y="9"><tspan text-anchor="end"><tspan class="decompiled">63.75% (793)</tspan> · <tspan class="known">33.84% (421)</tspan> · <tspan class="todo">0% (0)</tspan> · <tspan class="unused">2.41% (30)</tspan></tspan></text>
|
||||
<text class="todo" style="font-size: 12px; " x="747" y="9"><tspan text-anchor="end"><tspan class="decompiled">65.84% (819)</tspan> · <tspan class="known">31.75% (395)</tspan> · <tspan class="todo">0% (0)</tspan> · <tspan class="unused">2.41% (30)</tspan></tspan></text>
|
||||
<g transform="translate(0 20)">
|
||||
<rect width="476.18" height="6" x="0" y="0" class="decompiled"/>
|
||||
<rect width="252.80" height="6" x="476.18" y="0" class="known"/>
|
||||
<rect width="491.80" height="6" x="0" y="0" class="decompiled"/>
|
||||
<rect width="237.19" height="6" x="491.80" y="0" class="known"/>
|
||||
<rect width="18.01" height="6" x="728.99" y="0" class="unused"/>
|
||||
</g>
|
||||
<g transform="translate(0 31)">
|
||||
|
@ -1294,40 +1294,40 @@
|
|||
<rect width="12" height="12" x="225" y="360" class="decompiled"><title>int32_t __fastcall Math_Sin(int16_t angle);</title></rect>
|
||||
<rect width="12" height="12" x="240" y="360" class="decompiled"><title>int32_t __fastcall Math_SinImpl(int16_t angle);</title></rect>
|
||||
<rect width="12" height="12" x="255" y="360" class="decompiled"><title>uint32_t __fastcall Math_Sqrt(uint32_t n);</title></rect>
|
||||
<rect width="12" height="12" x="270" y="360" class="known"><title>int __cdecl Player_PlayFrame(LPVOID, LPVOID, LPVOID, DWORD, LPCRECT, DWORD, DWORD, DWORD);</title></rect>
|
||||
<rect width="12" height="12" x="285" y="360" class="known"><title>int __cdecl Movie_GetTotalFrames(LPVOID);</title></rect>
|
||||
<rect width="12" height="12" x="300" y="360" class="known"><title>int __cdecl Movie_GetCurrentFrame(LPVOID);</title></rect>
|
||||
<rect width="12" height="12" x="315" y="360" class="known"><title>int __cdecl Player_StartTimer(LPVOID);</title></rect>
|
||||
<rect width="12" height="12" x="330" y="360" class="known"><title>int __cdecl Player_InitMoviePlayback(LPVOID, LPVOID, LPVOID);</title></rect>
|
||||
<rect width="12" height="12" x="345" y="360" class="known"><title>int __cdecl Movie_SetSyncAdjust(LPVOID, LPVOID, DWORD);</title></rect>
|
||||
<rect width="12" height="12" x="360" y="360" class="known"><title>int __cdecl Player_InitSound(LPVOID, DWORD, DWORD, BOOL, DWORD, DWORD, DWORD, DWORD, DWORD);</title></rect>
|
||||
<rect width="12" height="12" x="375" y="360" class="known"><title>int __cdecl Movie_GetSoundChannels(LPVOID);</title></rect>
|
||||
<rect width="12" height="12" x="390" y="360" class="known"><title>int __cdecl Movie_GetSoundRate(LPVOID);</title></rect>
|
||||
<rect width="12" height="12" x="405" y="360" class="known"><title>int __cdecl Movie_GetSoundPrecision(LPVOID);</title></rect>
|
||||
<rect width="12" height="12" x="420" y="360" class="known"><title>int __cdecl Player_GetDSErrorCode(void);</title></rect>
|
||||
<rect width="12" height="12" x="435" y="360" class="known"><title>int __cdecl Player_InitSoundSystem(HWND);</title></rect>
|
||||
<rect width="12" height="12" x="450" y="360" class="known"><title>int __cdecl Player_BlankScreen(DWORD, DWORD, DWORD, DWORD);</title></rect>
|
||||
<rect width="12" height="12" x="465" y="360" class="known"><title>int __cdecl Player_InitPlaybackMode(HWND, LPVOID, DWORD, DWORD);</title></rect>
|
||||
<rect width="12" height="12" x="480" y="360" class="known"><title>int __cdecl Player_InitVideo(LPVOID, LPVOID, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD);</title></rect>
|
||||
<rect width="12" height="12" x="495" y="360" class="known"><title>int __cdecl Movie_GetXSize(LPVOID);</title></rect>
|
||||
<rect width="12" height="12" x="510" y="360" class="known"><title>int __cdecl Movie_GetYSize(LPVOID);</title></rect>
|
||||
<rect width="12" height="12" x="525" y="360" class="known"><title>int __cdecl Movie_GetFormat(LPVOID);</title></rect>
|
||||
<rect width="12" height="12" x="540" y="360" class="known"><title>int __cdecl Player_InitMovie(LPVOID, DWORD, DWORD, LPCTSTR, DWORD);</title></rect>
|
||||
<rect width="12" height="12" x="555" y="360" class="known"><title>int __cdecl Player_PassInDirectDrawObject(LPDIRECTDRAW3);</title></rect>
|
||||
<rect width="12" height="12" x="570" y="360" class="known"><title>int __cdecl Player_ReturnPlaybackMode(BOOL);</title></rect>
|
||||
<rect width="12" height="12" x="585" y="360" class="known"><title>int __cdecl Player_ShutDownSoundSystem(void);</title></rect>
|
||||
<rect width="12" height="12" x="600" y="360" class="known"><title>int __cdecl Player_ShutDownMovie(LPVOID);</title></rect>
|
||||
<rect width="12" height="12" x="615" y="360" class="known"><title>int __cdecl Player_ShutDownVideo(LPVOID);</title></rect>
|
||||
<rect width="12" height="12" x="630" y="360" class="known"><title>int __cdecl Player_ShutDownSound(LPVOID);</title></rect>
|
||||
<rect width="12" height="12" x="645" y="360" class="known"><title>int __cdecl Player_StopTimer(LPVOID);</title></rect>
|
||||
<rect width="12" height="12" x="270" y="360" class="decompiled"><title>int __cdecl Player_PlayFrame(LPVOID, LPVOID, LPVOID, DWORD, LPCRECT, DWORD, DWORD, DWORD);</title></rect>
|
||||
<rect width="12" height="12" x="285" y="360" class="decompiled"><title>int __cdecl Movie_GetTotalFrames(LPVOID);</title></rect>
|
||||
<rect width="12" height="12" x="300" y="360" class="decompiled"><title>int __cdecl Movie_GetCurrentFrame(LPVOID);</title></rect>
|
||||
<rect width="12" height="12" x="315" y="360" class="decompiled"><title>int __cdecl Player_StartTimer(LPVOID);</title></rect>
|
||||
<rect width="12" height="12" x="330" y="360" class="decompiled"><title>int __cdecl Player_InitMoviePlayback(LPVOID, LPVOID, LPVOID);</title></rect>
|
||||
<rect width="12" height="12" x="345" y="360" class="decompiled"><title>int __cdecl Movie_SetSyncAdjust(LPVOID, LPVOID, DWORD);</title></rect>
|
||||
<rect width="12" height="12" x="360" y="360" class="decompiled"><title>int __cdecl Player_InitSound(LPVOID, DWORD, DWORD, BOOL, DWORD, DWORD, DWORD, DWORD, DWORD);</title></rect>
|
||||
<rect width="12" height="12" x="375" y="360" class="decompiled"><title>int __cdecl Movie_GetSoundChannels(LPVOID);</title></rect>
|
||||
<rect width="12" height="12" x="390" y="360" class="decompiled"><title>int __cdecl Movie_GetSoundRate(LPVOID);</title></rect>
|
||||
<rect width="12" height="12" x="405" y="360" class="decompiled"><title>int __cdecl Movie_GetSoundPrecision(LPVOID);</title></rect>
|
||||
<rect width="12" height="12" x="420" y="360" class="decompiled"><title>int __cdecl Player_GetDSErrorCode(void);</title></rect>
|
||||
<rect width="12" height="12" x="435" y="360" class="decompiled"><title>int __cdecl Player_InitSoundSystem(HWND);</title></rect>
|
||||
<rect width="12" height="12" x="450" y="360" class="decompiled"><title>int __cdecl Player_BlankScreen(DWORD, DWORD, DWORD, DWORD);</title></rect>
|
||||
<rect width="12" height="12" x="465" y="360" class="decompiled"><title>int __cdecl Player_InitPlaybackMode(HWND, LPVOID, DWORD, DWORD);</title></rect>
|
||||
<rect width="12" height="12" x="480" y="360" class="decompiled"><title>int __cdecl Player_InitVideo(LPVOID, LPVOID, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD);</title></rect>
|
||||
<rect width="12" height="12" x="495" y="360" class="decompiled"><title>int __cdecl Movie_GetXSize(LPVOID);</title></rect>
|
||||
<rect width="12" height="12" x="510" y="360" class="decompiled"><title>int __cdecl Movie_GetYSize(LPVOID);</title></rect>
|
||||
<rect width="12" height="12" x="525" y="360" class="decompiled"><title>int __cdecl Movie_GetFormat(LPVOID);</title></rect>
|
||||
<rect width="12" height="12" x="540" y="360" class="decompiled"><title>int __cdecl Player_InitMovie(LPVOID, DWORD, DWORD, LPCTSTR, DWORD);</title></rect>
|
||||
<rect width="12" height="12" x="555" y="360" class="decompiled"><title>int __cdecl Player_PassInDirectDrawObject(LPDIRECTDRAW3);</title></rect>
|
||||
<rect width="12" height="12" x="570" y="360" class="decompiled"><title>int __cdecl Player_ReturnPlaybackMode(BOOL);</title></rect>
|
||||
<rect width="12" height="12" x="585" y="360" class="decompiled"><title>int __cdecl Player_ShutDownSoundSystem(void);</title></rect>
|
||||
<rect width="12" height="12" x="600" y="360" class="decompiled"><title>int __cdecl Player_ShutDownMovie(LPVOID);</title></rect>
|
||||
<rect width="12" height="12" x="615" y="360" class="decompiled"><title>int __cdecl Player_ShutDownVideo(LPVOID);</title></rect>
|
||||
<rect width="12" height="12" x="630" y="360" class="decompiled"><title>int __cdecl Player_ShutDownSound(LPVOID);</title></rect>
|
||||
<rect width="12" height="12" x="645" y="360" class="decompiled"><title>int __cdecl Player_StopTimer(LPVOID);</title></rect>
|
||||
</g>
|
||||
</g>
|
||||
<g transform="translate(0 546)">
|
||||
<text x="0" y="7.50">Tomb2.exe progress according to the function sizes:</text>
|
||||
<text class="todo" style="font-size: 12px; " x="747" y="9"><tspan text-anchor="end"><tspan class="decompiled">70.18%</tspan> · <tspan class="known">29.49%</tspan> · <tspan class="todo">0%</tspan> · <tspan class="unused">0.33%</tspan></tspan></text>
|
||||
<text class="todo" style="font-size: 12px; " x="747" y="9"><tspan text-anchor="end"><tspan class="decompiled">70.23%</tspan> · <tspan class="known">29.45%</tspan> · <tspan class="todo">0%</tspan> · <tspan class="unused">0.33%</tspan></tspan></text>
|
||||
<g transform="translate(0 20)">
|
||||
<rect width="524.25" height="6" x="0" y="0" class="decompiled"/>
|
||||
<rect width="220.31" height="6" x="524.25" y="0" class="known"/>
|
||||
<rect width="524.59" height="6" x="0" y="0" class="decompiled"/>
|
||||
<rect width="219.97" height="6" x="524.59" y="0" class="known"/>
|
||||
<rect width="2.44" height="6" x="744.56" y="0" class="unused"/>
|
||||
</g>
|
||||
<g transform="translate(0 31)">
|
||||
|
@ -2532,32 +2532,32 @@
|
|||
<rect width="0.10" height="0.10" x="746.11" y="363.05" class="known"><title>int32_t __cdecl GetRenderHeight(void);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="748.05" y="363.05" class="known"><title>int32_t __cdecl GetRenderWidth(void);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="735.07" y="365.61" class="decompiled"><title>int32_t __fastcall Math_Cos(int16_t angle);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="735.07" y="367.67" class="known"><title>int __cdecl Player_PlayFrame(LPVOID, LPVOID, LPVOID, DWORD, LPCRECT, DWORD, DWORD, DWORD);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="735.07" y="369.74" class="known"><title>int __cdecl Movie_GetTotalFrames(LPVOID);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="735.07" y="371.80" class="known"><title>int __cdecl Movie_GetCurrentFrame(LPVOID);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="735.07" y="373.87" class="known"><title>int __cdecl Player_StartTimer(LPVOID);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="735.07" y="375.93" class="known"><title>int __cdecl Player_InitMoviePlayback(LPVOID, LPVOID, LPVOID);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="737.48" y="365.61" class="known"><title>int __cdecl Movie_SetSyncAdjust(LPVOID, LPVOID, DWORD);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="737.48" y="367.67" class="known"><title>int __cdecl Player_InitSound(LPVOID, DWORD, DWORD, BOOL, DWORD, DWORD, DWORD, DWORD, DWORD);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="737.48" y="369.74" class="known"><title>int __cdecl Movie_GetSoundChannels(LPVOID);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="737.48" y="371.80" class="known"><title>int __cdecl Movie_GetSoundRate(LPVOID);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="737.48" y="373.87" class="known"><title>int __cdecl Movie_GetSoundPrecision(LPVOID);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="737.48" y="375.93" class="known"><title>int __cdecl Player_GetDSErrorCode(void);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="739.89" y="365.61" class="known"><title>int __cdecl Player_InitSoundSystem(HWND);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="741.91" y="365.61" class="known"><title>int __cdecl Player_BlankScreen(DWORD, DWORD, DWORD, DWORD);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="743.93" y="365.61" class="known"><title>int __cdecl Player_InitPlaybackMode(HWND, LPVOID, DWORD, DWORD);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="745.96" y="365.61" class="known"><title>int __cdecl Player_InitVideo(LPVOID, LPVOID, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="747.98" y="365.61" class="known"><title>int __cdecl Movie_GetXSize(LPVOID);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="739.89" y="368.07" class="known"><title>int __cdecl Movie_GetYSize(LPVOID);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="739.89" y="370.55" class="known"><title>int __cdecl Movie_GetFormat(LPVOID);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="739.89" y="373.03" class="known"><title>int __cdecl Player_InitMovie(LPVOID, DWORD, DWORD, LPCTSTR, DWORD);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="739.89" y="375.52" class="known"><title>int __cdecl Player_PassInDirectDrawObject(LPDIRECTDRAW3);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="741.90" y="368.07" class="known"><title>int __cdecl Player_ReturnPlaybackMode(BOOL);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="743.92" y="368.07" class="known"><title>int __cdecl Player_ShutDownSoundSystem(void);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="745.95" y="368.07" class="known"><title>int __cdecl Player_ShutDownMovie(LPVOID);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="747.97" y="368.07" class="known"><title>int __cdecl Player_ShutDownVideo(LPVOID);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="741.90" y="370.53" class="known"><title>int __cdecl Player_ShutDownSound(LPVOID);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="741.90" y="373.16" class="known"><title>int __cdecl Player_StopTimer(LPVOID);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="735.07" y="367.67" class="decompiled"><title>int __cdecl Player_PlayFrame(LPVOID, LPVOID, LPVOID, DWORD, LPCRECT, DWORD, DWORD, DWORD);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="735.07" y="369.74" class="decompiled"><title>int __cdecl Movie_GetTotalFrames(LPVOID);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="735.07" y="371.80" class="decompiled"><title>int __cdecl Movie_GetCurrentFrame(LPVOID);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="735.07" y="373.87" class="decompiled"><title>int __cdecl Player_StartTimer(LPVOID);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="735.07" y="375.93" class="decompiled"><title>int __cdecl Player_InitMoviePlayback(LPVOID, LPVOID, LPVOID);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="737.48" y="365.61" class="decompiled"><title>int __cdecl Movie_SetSyncAdjust(LPVOID, LPVOID, DWORD);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="737.48" y="367.67" class="decompiled"><title>int __cdecl Player_InitSound(LPVOID, DWORD, DWORD, BOOL, DWORD, DWORD, DWORD, DWORD, DWORD);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="737.48" y="369.74" class="decompiled"><title>int __cdecl Movie_GetSoundChannels(LPVOID);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="737.48" y="371.80" class="decompiled"><title>int __cdecl Movie_GetSoundRate(LPVOID);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="737.48" y="373.87" class="decompiled"><title>int __cdecl Movie_GetSoundPrecision(LPVOID);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="737.48" y="375.93" class="decompiled"><title>int __cdecl Player_GetDSErrorCode(void);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="739.89" y="365.61" class="decompiled"><title>int __cdecl Player_InitSoundSystem(HWND);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="741.91" y="365.61" class="decompiled"><title>int __cdecl Player_BlankScreen(DWORD, DWORD, DWORD, DWORD);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="743.93" y="365.61" class="decompiled"><title>int __cdecl Player_InitPlaybackMode(HWND, LPVOID, DWORD, DWORD);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="745.96" y="365.61" class="decompiled"><title>int __cdecl Player_InitVideo(LPVOID, LPVOID, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="747.98" y="365.61" class="decompiled"><title>int __cdecl Movie_GetXSize(LPVOID);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="739.89" y="368.07" class="decompiled"><title>int __cdecl Movie_GetYSize(LPVOID);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="739.89" y="370.55" class="decompiled"><title>int __cdecl Movie_GetFormat(LPVOID);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="739.89" y="373.03" class="decompiled"><title>int __cdecl Player_InitMovie(LPVOID, DWORD, DWORD, LPCTSTR, DWORD);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="739.89" y="375.52" class="decompiled"><title>int __cdecl Player_PassInDirectDrawObject(LPDIRECTDRAW3);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="741.90" y="368.07" class="decompiled"><title>int __cdecl Player_ReturnPlaybackMode(BOOL);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="743.92" y="368.07" class="decompiled"><title>int __cdecl Player_ShutDownSoundSystem(void);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="745.95" y="368.07" class="decompiled"><title>int __cdecl Player_ShutDownMovie(LPVOID);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="747.97" y="368.07" class="decompiled"><title>int __cdecl Player_ShutDownVideo(LPVOID);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="741.90" y="370.53" class="decompiled"><title>int __cdecl Player_ShutDownSound(LPVOID);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="741.90" y="373.16" class="decompiled"><title>int __cdecl Player_StopTimer(LPVOID);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="741.90" y="375.80" class="known"><title>void __cdecl flip_map_effect(ITEM *item);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="743.78" y="370.53" class="known"><title>void __cdecl reset_hair(ITEM *item);</title></rect>
|
||||
<rect width="0.10" height="0.10" x="745.86" y="370.53" class="decompiled"><title>void __cdecl Inv_DoInventoryPicture(void);</title></rect>
|
||||
|
|
Before Width: | Height: | Size: 369 KiB After Width: | Height: | Size: 369 KiB |
|
@ -4165,32 +4165,32 @@ typedef enum {
|
|||
0x00457C79 0x001A + int32_t __fastcall Math_SinImpl(int16_t angle);
|
||||
0x00457C93 0x002C + uint32_t __fastcall Math_Sqrt(uint32_t n);
|
||||
|
||||
0x00458D00 0x0006 * int __cdecl Player_PlayFrame(LPVOID, LPVOID, LPVOID, DWORD, LPCRECT, DWORD, DWORD, DWORD);
|
||||
0x00458D06 0x0006 * int __cdecl Movie_GetTotalFrames(LPVOID);
|
||||
0x00458D0C 0x0006 * int __cdecl Movie_GetCurrentFrame(LPVOID);
|
||||
0x00458D12 0x0006 * int __cdecl Player_StartTimer(LPVOID);
|
||||
0x00458D18 0x0006 * int __cdecl Player_InitMoviePlayback(LPVOID, LPVOID, LPVOID);
|
||||
0x00458D1E 0x0006 * int __cdecl Movie_SetSyncAdjust(LPVOID, LPVOID, DWORD);
|
||||
0x00458D24 0x0006 * int __cdecl Player_InitSound(LPVOID, DWORD, DWORD, BOOL, DWORD, DWORD, DWORD, DWORD, DWORD);
|
||||
0x00458D2A 0x0006 * int __cdecl Movie_GetSoundChannels(LPVOID);
|
||||
0x00458D30 0x0006 * int __cdecl Movie_GetSoundRate(LPVOID);
|
||||
0x00458D36 0x0006 * int __cdecl Movie_GetSoundPrecision(LPVOID);
|
||||
0x00458D3C 0x0006 * int __cdecl Player_GetDSErrorCode(void);
|
||||
0x00458D42 0x0006 * int __cdecl Player_InitSoundSystem(HWND);
|
||||
0x00458D48 0x0006 * int __cdecl Player_BlankScreen(DWORD, DWORD, DWORD, DWORD);
|
||||
0x00458D4E 0x0006 * int __cdecl Player_InitPlaybackMode(HWND, LPVOID, DWORD, DWORD);
|
||||
0x00458D54 0x0006 * int __cdecl Player_InitVideo(LPVOID, LPVOID, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD);
|
||||
0x00458D5A 0x0006 * int __cdecl Movie_GetXSize(LPVOID);
|
||||
0x00458D60 0x0006 * int __cdecl Movie_GetYSize(LPVOID);
|
||||
0x00458D66 0x0006 * int __cdecl Movie_GetFormat(LPVOID);
|
||||
0x00458D6C 0x0006 * int __cdecl Player_InitMovie(LPVOID, DWORD, DWORD, LPCTSTR, DWORD);
|
||||
0x00458D72 0x0006 * int __cdecl Player_PassInDirectDrawObject(LPDIRECTDRAW3);
|
||||
0x00458D78 0x0006 * int __cdecl Player_ReturnPlaybackMode(BOOL);
|
||||
0x00458D7E 0x0006 * int __cdecl Player_ShutDownSoundSystem(void);
|
||||
0x00458D84 0x0006 * int __cdecl Player_ShutDownMovie(LPVOID);
|
||||
0x00458D8A 0x0006 * int __cdecl Player_ShutDownVideo(LPVOID);
|
||||
0x00458D90 0x0006 * int __cdecl Player_ShutDownSound(LPVOID);
|
||||
0x00458D96 0x0006 * int __cdecl Player_StopTimer(LPVOID);
|
||||
0x00458D00 0x0006 + int __cdecl Player_PlayFrame(LPVOID, LPVOID, LPVOID, DWORD, LPCRECT, DWORD, DWORD, DWORD);
|
||||
0x00458D06 0x0006 + int __cdecl Movie_GetTotalFrames(LPVOID);
|
||||
0x00458D0C 0x0006 + int __cdecl Movie_GetCurrentFrame(LPVOID);
|
||||
0x00458D12 0x0006 + int __cdecl Player_StartTimer(LPVOID);
|
||||
0x00458D18 0x0006 + int __cdecl Player_InitMoviePlayback(LPVOID, LPVOID, LPVOID);
|
||||
0x00458D1E 0x0006 + int __cdecl Movie_SetSyncAdjust(LPVOID, LPVOID, DWORD);
|
||||
0x00458D24 0x0006 + int __cdecl Player_InitSound(LPVOID, DWORD, DWORD, BOOL, DWORD, DWORD, DWORD, DWORD, DWORD);
|
||||
0x00458D2A 0x0006 + int __cdecl Movie_GetSoundChannels(LPVOID);
|
||||
0x00458D30 0x0006 + int __cdecl Movie_GetSoundRate(LPVOID);
|
||||
0x00458D36 0x0006 + int __cdecl Movie_GetSoundPrecision(LPVOID);
|
||||
0x00458D3C 0x0006 + int __cdecl Player_GetDSErrorCode(void);
|
||||
0x00458D42 0x0006 + int __cdecl Player_InitSoundSystem(HWND);
|
||||
0x00458D48 0x0006 + int __cdecl Player_BlankScreen(DWORD, DWORD, DWORD, DWORD);
|
||||
0x00458D4E 0x0006 + int __cdecl Player_InitPlaybackMode(HWND, LPVOID, DWORD, DWORD);
|
||||
0x00458D54 0x0006 + int __cdecl Player_InitVideo(LPVOID, LPVOID, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD);
|
||||
0x00458D5A 0x0006 + int __cdecl Movie_GetXSize(LPVOID);
|
||||
0x00458D60 0x0006 + int __cdecl Movie_GetYSize(LPVOID);
|
||||
0x00458D66 0x0006 + int __cdecl Movie_GetFormat(LPVOID);
|
||||
0x00458D6C 0x0006 + int __cdecl Player_InitMovie(LPVOID, DWORD, DWORD, LPCTSTR, DWORD);
|
||||
0x00458D72 0x0006 + int __cdecl Player_PassInDirectDrawObject(LPDIRECTDRAW3);
|
||||
0x00458D78 0x0006 + int __cdecl Player_ReturnPlaybackMode(BOOL);
|
||||
0x00458D7E 0x0006 + int __cdecl Player_ShutDownSoundSystem(void);
|
||||
0x00458D84 0x0006 + int __cdecl Player_ShutDownMovie(LPVOID);
|
||||
0x00458D8A 0x0006 + int __cdecl Player_ShutDownVideo(LPVOID);
|
||||
0x00458D90 0x0006 + int __cdecl Player_ShutDownSound(LPVOID);
|
||||
0x00458D96 0x0006 + int __cdecl Player_StopTimer(LPVOID);
|
||||
|
||||
|
||||
# VARIABLES
|
||||
|
|
|
@ -239,6 +239,7 @@ typedef struct {
|
|||
|
||||
void *primary_surface;
|
||||
enum AVPixelFormat primary_surface_pixel_format;
|
||||
int32_t primary_surface_stride;
|
||||
|
||||
VIDEO_SURFACE_ALLOCATOR_FUNC surface_allocator_func;
|
||||
void *surface_allocator_func_user_data;
|
||||
|
@ -723,12 +724,14 @@ static int M_UploadTexture(M_STATE *is, AVFrame *frame)
|
|||
is->primary_surface, is->surface_lock_func_user_data);
|
||||
|
||||
if (pixels != NULL) {
|
||||
uint8_t *surf_planes[4];
|
||||
int surf_linesize[4];
|
||||
av_image_fill_arrays(
|
||||
surf_planes, surf_linesize, pixels,
|
||||
is->primary_surface_pixel_format, is->surface_width,
|
||||
is->surface_height, 1);
|
||||
uint8_t *surf_planes[4] = { pixels, NULL, NULL, NULL };
|
||||
int surf_linesize[4] = { 0, 0, 0, 0 };
|
||||
if (is->primary_surface_stride > 0) {
|
||||
surf_linesize[0] = is->primary_surface_stride;
|
||||
} else {
|
||||
surf_linesize[0] = av_image_get_linesize(
|
||||
is->primary_surface_pixel_format, is->surface_width, 0);
|
||||
}
|
||||
|
||||
surf_planes[0] += is->target_surface_y * surf_linesize[0];
|
||||
surf_planes[0] += av_image_get_linesize(
|
||||
|
@ -1951,6 +1954,17 @@ void Video_SetSurfacePixelFormat(VIDEO *video, enum AVPixelFormat pixel_format)
|
|||
M_ReallocPrimarySurface(is, is->surface_width, is->surface_height, false);
|
||||
}
|
||||
|
||||
void Video_SetSurfaceStride(VIDEO *video, const int32_t stride)
|
||||
{
|
||||
M_STATE *const is = video->priv;
|
||||
if (is->primary_surface_stride == stride) {
|
||||
return;
|
||||
}
|
||||
|
||||
is->primary_surface_stride = stride;
|
||||
M_ReallocPrimarySurface(is, is->surface_width, is->surface_height, false);
|
||||
}
|
||||
|
||||
void Video_SetSurfaceAllocatorFunc(
|
||||
VIDEO *const video, const VIDEO_SURFACE_ALLOCATOR_FUNC func,
|
||||
void *const user_data)
|
||||
|
|
|
@ -17,6 +17,7 @@ VIDEO *Video_Open(const char *path);
|
|||
void Video_SetVolume(VIDEO *video, double volume);
|
||||
void Video_SetSurfaceSize(VIDEO *video, int32_t width, int32_t height);
|
||||
void Video_SetSurfacePixelFormat(VIDEO *video, enum AVPixelFormat pixel_format);
|
||||
void Video_SetSurfaceStride(VIDEO *video, int32_t stride);
|
||||
void Video_SetSurfaceAllocatorFunc(
|
||||
VIDEO *video, VIDEO_SURFACE_ALLOCATOR_FUNC func, void *user_data);
|
||||
void Video_SetSurfaceDeallocatorFunc(
|
||||
|
|
|
@ -546,7 +546,7 @@ int32_t __cdecl WinGameStart(void)
|
|||
{
|
||||
// try {
|
||||
WinVidStart();
|
||||
RenderStart(1);
|
||||
RenderStart(true);
|
||||
WinInStart();
|
||||
// } catch (int32_t error) {
|
||||
// return error;
|
||||
|
@ -558,7 +558,7 @@ void __cdecl Shell_Shutdown(void)
|
|||
{
|
||||
Console_Shutdown();
|
||||
WinInFinish();
|
||||
RenderFinish(1);
|
||||
RenderFinish(true);
|
||||
WinVidFinish();
|
||||
WinVidHideGameWindow();
|
||||
if (g_ErrorMessage[0]) {
|
||||
|
|
|
@ -1,162 +1,381 @@
|
|||
#include "decomp/fmv.h"
|
||||
|
||||
#include "config.h"
|
||||
#include "decomp/decomp.h"
|
||||
#include "game/input.h"
|
||||
#include "game/music.h"
|
||||
#include "game/shell.h"
|
||||
#include "game/sound.h"
|
||||
#include "global/funcs.h"
|
||||
#include "global/vars.h"
|
||||
#include "lib/ddraw.h"
|
||||
|
||||
#include <libtrx/engine/video.h>
|
||||
#include <libtrx/log.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
static bool m_Muted = false;
|
||||
static LPDIRECTDRAWPALETTE m_DDrawPalette = NULL;
|
||||
static LPDDS m_PrimaryBufferSurface = NULL;
|
||||
static LPDDS m_BackBufferSurface = NULL;
|
||||
static DDPIXELFORMAT m_PixelFormat;
|
||||
|
||||
static void M_Begin(void);
|
||||
static void M_Play(const char *file_name);
|
||||
static void M_End(void);
|
||||
static bool M_CreateScreenBuffers(void);
|
||||
static void M_ReleaseScreenBuffers(void);
|
||||
|
||||
static void M_Begin(void)
|
||||
static void *M_AllocateSurface(int32_t width, int32_t height, void *user_data);
|
||||
static void M_DeallocateSurface(void *surface, void *user_data);
|
||||
static void M_ClearSurface(void *surface, void *user_data);
|
||||
static void M_RenderBegin(void *surface, void *user_data);
|
||||
static void M_RenderEnd(void *surface, void *user_data);
|
||||
static void *M_LockSurface(void *surface, void *user_data);
|
||||
static void M_UnlockSurface(void *surface, void *user_data);
|
||||
static void M_UploadSurface(void *surface, void *user_data);
|
||||
|
||||
static bool M_CreateScreenBuffers(void)
|
||||
{
|
||||
m_PrimaryBufferSurface = NULL;
|
||||
m_BackBufferSurface = NULL;
|
||||
m_DDrawPalette = NULL;
|
||||
|
||||
if (g_SavedAppSettings.fullscreen) {
|
||||
{
|
||||
DDSDESC dsp = {
|
||||
.dwSize = sizeof(DDSDESC),
|
||||
.dwFlags = DDSD_BACKBUFFERCOUNT | DDSD_CAPS,
|
||||
.dwBackBufferCount = 1,
|
||||
.ddsCaps.dwCaps =
|
||||
DDSCAPS_PRIMARYSURFACE | DDSCAPS_FLIP | DDSCAPS_COMPLEX,
|
||||
};
|
||||
|
||||
HRESULT rc = DDrawSurfaceCreate(&dsp, &m_PrimaryBufferSurface);
|
||||
if (FAILED(rc)) {
|
||||
LOG_ERROR("Failed to create primary screen buffer: %x", rc);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
DDSCAPS caps = {
|
||||
.dwCaps = DDSCAPS_BACKBUFFER,
|
||||
};
|
||||
const HRESULT rc =
|
||||
m_PrimaryBufferSurface->lpVtbl->GetAttachedSurface(
|
||||
m_PrimaryBufferSurface, &caps, &m_BackBufferSurface);
|
||||
if (FAILED(rc)) {
|
||||
LOG_ERROR("Failed to create back screen buffer: %x", rc);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (g_GameVid_IsVga) {
|
||||
PALETTEENTRY palette[256];
|
||||
|
||||
// Populate the palette with a palette corresponding to
|
||||
// AV_PIX_FMT_RGB8
|
||||
for (int32_t i = 0; i < 256; i++) {
|
||||
PALETTEENTRY *col = &palette[i];
|
||||
|
||||
col->peRed = (i >> 5) * 36;
|
||||
col->peGreen = ((i >> 2) & 7) * 36;
|
||||
col->peBlue = (i & 3) * 85;
|
||||
}
|
||||
|
||||
HRESULT rc = IDirectDraw_CreatePalette(
|
||||
g_DDraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256 | DDPCAPS_INITIALIZE,
|
||||
palette, &m_DDrawPalette, 0);
|
||||
if (FAILED(rc)) {
|
||||
LOG_ERROR(
|
||||
"Failed to set primary screen buffer palette: %x", rc);
|
||||
return false;
|
||||
}
|
||||
|
||||
rc = m_PrimaryBufferSurface->lpVtbl->SetPalette(
|
||||
m_PrimaryBufferSurface, m_DDrawPalette);
|
||||
if (FAILED(rc)) {
|
||||
LOG_ERROR(
|
||||
"Failed to attach palette to the primary screen buffer: %x",
|
||||
rc);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
DDSDESC dsp = {
|
||||
.dwSize = sizeof(DDSDESC),
|
||||
.dwFlags = DDSD_CAPS,
|
||||
.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE,
|
||||
};
|
||||
|
||||
const HRESULT rc = DDrawSurfaceCreate(&dsp, &m_PrimaryBufferSurface);
|
||||
if (FAILED(rc)) {
|
||||
LOG_ERROR("Failed to create primary screen buffer: %x", rc);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
memset(&m_PixelFormat, 0, sizeof(m_PixelFormat));
|
||||
m_PixelFormat.dwSize = sizeof(DDPIXELFORMAT);
|
||||
const HRESULT rc = IDirectDrawSurface_GetPixelFormat(
|
||||
m_PrimaryBufferSurface, &m_PixelFormat);
|
||||
if (FAILED(rc)) {
|
||||
LOG_ERROR(
|
||||
"Failed to get pixel format of the primary screen buffer: %x", rc);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void M_ReleaseScreenBuffers(void)
|
||||
{
|
||||
if (m_PrimaryBufferSurface != NULL) {
|
||||
m_PrimaryBufferSurface->lpVtbl->Release(m_PrimaryBufferSurface);
|
||||
m_PrimaryBufferSurface = NULL;
|
||||
}
|
||||
|
||||
if (m_DDrawPalette != NULL) {
|
||||
m_DDrawPalette->lpVtbl->Release(m_DDrawPalette);
|
||||
}
|
||||
}
|
||||
|
||||
static void *M_AllocateSurface(
|
||||
const int32_t width, const int32_t height, void *const user_data)
|
||||
{
|
||||
VIDEO *const video = user_data;
|
||||
|
||||
LPDDS surface;
|
||||
DDSDESC dsp = {
|
||||
.dwSize = sizeof(DDSDESC),
|
||||
.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS,
|
||||
.dwWidth = width,
|
||||
.dwHeight = height,
|
||||
.ddsCaps = {
|
||||
.dwCaps = DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN,
|
||||
},
|
||||
};
|
||||
const HRESULT rc = DDrawSurfaceCreate(&dsp, &surface);
|
||||
if (FAILED(rc)) {
|
||||
LOG_ERROR("Failed to create render buffer: %x", rc);
|
||||
}
|
||||
|
||||
// Set pixel format
|
||||
if (m_PixelFormat.dwFlags & DDPF_PALETTEINDEXED8) {
|
||||
Video_SetSurfacePixelFormat(video, AV_PIX_FMT_RGB8);
|
||||
} else if (m_PixelFormat.dwRGBBitCount == 16) {
|
||||
if (m_PixelFormat.dwRBitMask == 0xF800) {
|
||||
Video_SetSurfacePixelFormat(video, AV_PIX_FMT_RGB565);
|
||||
} else {
|
||||
Video_SetSurfacePixelFormat(video, AV_PIX_FMT_BGR565);
|
||||
}
|
||||
} else if (m_PixelFormat.dwRGBBitCount == 24) {
|
||||
if (m_PixelFormat.dwRBitMask == 255) {
|
||||
Video_SetSurfacePixelFormat(video, AV_PIX_FMT_RGB24);
|
||||
} else {
|
||||
Video_SetSurfacePixelFormat(video, AV_PIX_FMT_BGR24);
|
||||
}
|
||||
} else if (m_PixelFormat.dwRGBBitCount == 32) {
|
||||
if (m_PixelFormat.dwRBitMask == 255) {
|
||||
Video_SetSurfacePixelFormat(video, AV_PIX_FMT_RGB0);
|
||||
} else {
|
||||
Video_SetSurfacePixelFormat(video, AV_PIX_FMT_BGR0);
|
||||
}
|
||||
}
|
||||
|
||||
// Set pitch
|
||||
surface->lpVtbl->GetSurfaceDesc(surface, &dsp);
|
||||
Video_SetSurfaceStride(video, dsp.lPitch);
|
||||
|
||||
return surface;
|
||||
}
|
||||
|
||||
static void M_DeallocateSurface(void *const surface_, void *const user_data)
|
||||
{
|
||||
LPDDS surface = surface_;
|
||||
const HRESULT rc = surface->lpVtbl->Release(surface);
|
||||
if (FAILED(rc)) {
|
||||
LOG_ERROR("Failed to release render buffer: %x", rc);
|
||||
}
|
||||
}
|
||||
|
||||
static void M_ClearSurface(void *const surface_, void *const user_data)
|
||||
{
|
||||
LPDDS surface = surface_;
|
||||
WinVidClearBuffer(surface, NULL, 0);
|
||||
}
|
||||
|
||||
static void M_RenderBegin(void *const surface, void *const user_data)
|
||||
{
|
||||
}
|
||||
|
||||
static void M_RenderEnd(void *const surface_, void *const user_data)
|
||||
{
|
||||
LPDDS surface = surface_;
|
||||
|
||||
if (g_SavedAppSettings.fullscreen) {
|
||||
LPRECT rect = NULL;
|
||||
HRESULT rc = m_BackBufferSurface->lpVtbl->Blt(
|
||||
m_BackBufferSurface, rect, surface, rect, DDBLT_WAIT, NULL);
|
||||
if (FAILED(rc)) {
|
||||
LOG_ERROR(
|
||||
"Failed to copy pixels to the primary screen buffer: %x", rc);
|
||||
}
|
||||
|
||||
rc = m_PrimaryBufferSurface->lpVtbl->Flip(
|
||||
m_PrimaryBufferSurface, NULL, DDFLIP_WAIT);
|
||||
if (FAILED(rc)) {
|
||||
LOG_ERROR("Failed to flip the primary screen buffer: %x", rc);
|
||||
}
|
||||
} else {
|
||||
LPRECT rect = &g_PhdWinRect;
|
||||
RECT dst_rect = {
|
||||
.left = g_GameWindowPositionX + rect->left,
|
||||
.top = g_GameWindowPositionY + rect->top,
|
||||
.bottom = g_GameWindowPositionY + rect->bottom,
|
||||
.right = g_GameWindowPositionX + rect->right,
|
||||
};
|
||||
const HRESULT rc = m_PrimaryBufferSurface->lpVtbl->Blt(
|
||||
m_PrimaryBufferSurface, &dst_rect, surface, rect, DDBLT_WAIT, NULL);
|
||||
if (FAILED(rc)) {
|
||||
LOG_ERROR(
|
||||
"Failed to copy pixels to the primary screen buffer: %x", rc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void *M_LockSurface(void *const surface_, void *const user_data)
|
||||
{
|
||||
LPDDS surface = surface_;
|
||||
LPDDSURFACEDESC desc = user_data;
|
||||
assert(desc != NULL);
|
||||
|
||||
HRESULT rc;
|
||||
while (true) {
|
||||
rc = surface->lpVtbl->Lock(surface, 0, desc, 0, 0);
|
||||
if (rc != DDERR_WASSTILLDRAWING) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (rc == DDERR_SURFACELOST) {
|
||||
surface->lpVtbl->Restore(surface);
|
||||
}
|
||||
|
||||
if (FAILED(rc)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return desc->lpSurface;
|
||||
}
|
||||
|
||||
static void M_UnlockSurface(void *const surface_, void *const user_data)
|
||||
{
|
||||
LPDDS surface = surface_;
|
||||
LPDDSURFACEDESC desc = user_data;
|
||||
surface->lpVtbl->Unlock(surface, desc);
|
||||
}
|
||||
|
||||
static void M_UploadSurface(void *const surface, void *const user_data)
|
||||
{
|
||||
}
|
||||
|
||||
static bool M_EnterFMVMode(void)
|
||||
{
|
||||
g_IsFMVPlaying = true;
|
||||
Music_Stop();
|
||||
ShowCursor(false);
|
||||
RenderFinish(true);
|
||||
Music_Stop();
|
||||
|
||||
RenderFinish(false);
|
||||
if (!M_CreateScreenBuffers()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void M_Play(const char *const file_name)
|
||||
static void M_ExitFMVMode(void)
|
||||
{
|
||||
const char *const full_path = GetFullPath(file_name);
|
||||
WinPlayFMV(full_path, true);
|
||||
WinStopFMV(true);
|
||||
}
|
||||
M_ReleaseScreenBuffers();
|
||||
|
||||
static void M_End(void)
|
||||
{
|
||||
g_IsFMVPlaying = false;
|
||||
if (!g_IsGameToExit) {
|
||||
FmvBackToGame();
|
||||
RenderStart(true);
|
||||
}
|
||||
ShowCursor(true);
|
||||
}
|
||||
|
||||
static void M_Play(const char *const file_name)
|
||||
{
|
||||
g_IsFMVPlaying = true;
|
||||
const char *const full_path = GetFullPath(file_name);
|
||||
WinPlayFMV(full_path, true);
|
||||
g_IsFMVPlaying = false;
|
||||
}
|
||||
|
||||
bool __cdecl PlayFMV(const char *const file_name)
|
||||
{
|
||||
M_Begin();
|
||||
M_Play(file_name);
|
||||
M_End();
|
||||
if (M_EnterFMVMode()) {
|
||||
M_Play(file_name);
|
||||
}
|
||||
M_ExitFMVMode();
|
||||
return g_IsGameToExit;
|
||||
}
|
||||
|
||||
bool __cdecl IntroFMV(
|
||||
const char *const file_name_1, const char *const file_name_2)
|
||||
{
|
||||
M_Begin();
|
||||
M_Play(file_name_1);
|
||||
M_Play(file_name_2);
|
||||
M_End();
|
||||
if (M_EnterFMVMode()) {
|
||||
M_Play(file_name_1);
|
||||
M_Play(file_name_2);
|
||||
}
|
||||
M_ExitFMVMode();
|
||||
return g_IsGameToExit;
|
||||
}
|
||||
|
||||
void __cdecl FmvBackToGame(void)
|
||||
{
|
||||
RenderStart(true);
|
||||
}
|
||||
|
||||
void __cdecl WinPlayFMV(const char *const file_name, const bool is_playback)
|
||||
{
|
||||
const RECT rect = {
|
||||
.left = 0,
|
||||
.top = 0,
|
||||
.right = 640,
|
||||
.bottom = 480,
|
||||
};
|
||||
if (Player_PassInDirectDrawObject(g_DDraw) != 0) {
|
||||
DDSURFACEDESC surface_desc = { .dwSize = sizeof(DDSURFACEDESC), 0 };
|
||||
|
||||
VIDEO *video = Video_Open(file_name);
|
||||
if (video == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Player_InitMovie(&g_MovieContext, 0, 0, file_name, 0x200000) != 0) {
|
||||
return;
|
||||
}
|
||||
Video_SetSurfaceAllocatorFunc(video, M_AllocateSurface, video);
|
||||
Video_SetSurfaceDeallocatorFunc(video, M_DeallocateSurface, NULL);
|
||||
Video_SetSurfaceClearFunc(video, M_ClearSurface, NULL);
|
||||
Video_SetRenderBeginFunc(video, M_RenderBegin, NULL);
|
||||
Video_SetRenderEndFunc(video, M_RenderEnd, NULL);
|
||||
Video_SetSurfaceLockFunc(video, M_LockSurface, &surface_desc);
|
||||
Video_SetSurfaceUnlockFunc(video, M_UnlockSurface, &surface_desc);
|
||||
Video_SetSurfaceUploadFunc(video, M_UploadSurface, NULL);
|
||||
|
||||
if (Movie_GetFormat(g_MovieContext) != 130) {
|
||||
return;
|
||||
}
|
||||
Video_Start(video);
|
||||
while (video->is_playing) {
|
||||
Video_SetVolume(
|
||||
video,
|
||||
m_Muted ? 0 : g_OptionSoundVolume / (float)Sound_GetMaxVolume());
|
||||
|
||||
const int32_t y_size = Movie_GetYSize(g_MovieContext);
|
||||
const int32_t x_size = Movie_GetXSize(g_MovieContext);
|
||||
const int32_t x_offset = 320 - x_size;
|
||||
const int32_t y_offset = 240 - y_size;
|
||||
Video_SetSurfaceSize(video, g_PhdWinWidth, g_PhdWinHeight);
|
||||
|
||||
if (Player_InitVideo(
|
||||
&g_FmvContext, g_MovieContext, x_size, y_size, x_offset, y_offset,
|
||||
0, 0, 640, 480, 0, 1, 13)
|
||||
!= 0) {
|
||||
return;
|
||||
}
|
||||
Video_PumpEvents(video);
|
||||
|
||||
if (!is_playback) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Player_InitPlaybackMode(g_GameWindowHandle, g_FmvContext, 1, 0) != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
Player_BlankScreen(rect.left, rect.top, rect.right, rect.bottom);
|
||||
if (Player_InitSoundSystem(g_GameWindowHandle) != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Player_GetDSErrorCode() < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const int32_t sound_precision = Movie_GetSoundPrecision(g_MovieContext);
|
||||
const int32_t sound_rate = Movie_GetSoundRate(g_MovieContext);
|
||||
const int32_t sound_channels = Movie_GetSoundChannels(g_MovieContext);
|
||||
const bool is_uncompressed = sound_precision != 4;
|
||||
const int32_t sound_format = is_uncompressed ? 1 : 4;
|
||||
if (Player_InitSound(
|
||||
&g_FmvSoundContext, 16384, sound_format, is_uncompressed, 4096,
|
||||
sound_channels, sound_rate, sound_precision, 2)
|
||||
!= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
Movie_SetSyncAdjust(g_MovieContext, g_FmvSoundContext, 4);
|
||||
if (Player_InitMoviePlayback(
|
||||
g_MovieContext, g_FmvContext, g_FmvSoundContext)
|
||||
!= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
Input_Update();
|
||||
Player_StartTimer(g_MovieContext);
|
||||
Player_BlankScreen(rect.left, rect.top, rect.right, rect.bottom);
|
||||
Input_Update();
|
||||
while (Movie_GetCurrentFrame(g_MovieContext)
|
||||
< Movie_GetTotalFrames(g_MovieContext)) {
|
||||
if (Player_PlayFrame(
|
||||
g_MovieContext, g_FmvContext, g_FmvSoundContext, 0, &rect, 0, 0,
|
||||
0)
|
||||
!= 0) {
|
||||
break;
|
||||
}
|
||||
WinVidSpinMessageLoop(false);
|
||||
|
||||
if (Input_Update()) {
|
||||
Video_Stop(video);
|
||||
break;
|
||||
}
|
||||
if ((g_Input & IN_OPTION) != 0) {
|
||||
if ((g_InputDB & IN_OPTION) != 0) {
|
||||
Video_Stop(video);
|
||||
break;
|
||||
}
|
||||
}
|
||||
Video_Close(video);
|
||||
}
|
||||
|
||||
void __cdecl WinStopFMV(const bool is_playback)
|
||||
void __cdecl WinStopFMV(bool is_playback)
|
||||
{
|
||||
Player_StopTimer(g_MovieContext);
|
||||
Player_ShutDownSound(&g_FmvSoundContext);
|
||||
Player_ShutDownVideo(&g_FmvContext);
|
||||
Player_ShutDownMovie(&g_MovieContext);
|
||||
Player_ShutDownSoundSystem();
|
||||
if (is_playback) {
|
||||
Player_ReturnPlaybackMode(is_playback);
|
||||
}
|
||||
}
|
||||
|
||||
bool __cdecl S_PlayFMV(const char *const file_name)
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
bool __cdecl PlayFMV(const char *file_name);
|
||||
bool __cdecl IntroFMV(const char *file_name_1, const char *file_name_2);
|
||||
void __cdecl FmvBackToGame(void);
|
||||
void __cdecl WinPlayFMV(const char *file_name, bool is_playback);
|
||||
void __cdecl WinStopFMV(bool is_playback);
|
||||
bool __cdecl S_PlayFMV(const char *file_name);
|
||||
|
|
|
@ -57,7 +57,7 @@ bool Input_Update(void)
|
|||
return result;
|
||||
}
|
||||
|
||||
if (g_InputDB & IN_CONSOLE) {
|
||||
if (!g_IsFMVPlaying && (g_InputDB & IN_CONSOLE)) {
|
||||
Console_Open();
|
||||
g_Input = 0;
|
||||
g_InputDB = 0;
|
||||
|
|
|
@ -400,3 +400,13 @@ bool Sound_IsAvailable(const SOUND_EFFECT_ID sample_id)
|
|||
return sample_id >= 0 && sample_id < SFX_NUMBER_OF
|
||||
&& g_SampleLUT[sample_id] != -1;
|
||||
}
|
||||
|
||||
int32_t Sound_GetMinVolume(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t Sound_GetMaxVolume(void)
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
|
|
|
@ -12,3 +12,5 @@ void __cdecl Sound_Effect(
|
|||
void __cdecl Sound_StopEffect(SOUND_EFFECT_ID sample_id);
|
||||
void __cdecl Sound_StopAllSamples(void);
|
||||
void __cdecl Sound_EndScene(void);
|
||||
int32_t Sound_GetMinVolume(void);
|
||||
int32_t Sound_GetMaxVolume(void);
|
||||
|
|
|
@ -401,30 +401,4 @@
|
|||
#define SE_SetupWindowProc ((LRESULT __stdcall (*)(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam))0x00456FA0)
|
||||
#define SE_PassMessageToImage ((void __cdecl (*)(HWND hWnd, UINT uMsg, WPARAM wParam))0x004571E0)
|
||||
#define UT_MemBlt ((void __cdecl (*)(BYTE *dstBuf, DWORD dstX, DWORD dstY, DWORD width, DWORD height, DWORD dstPitch, BYTE *srcBuf, DWORD srcX, DWORD srcY, DWORD srcPitch))0x00457210)
|
||||
#define Player_PlayFrame ((int __cdecl (*)(LPVOID, LPVOID, LPVOID, DWORD, LPCRECT, DWORD, DWORD, DWORD))0x00458D00)
|
||||
#define Movie_GetTotalFrames ((int __cdecl (*)(LPVOID))0x00458D06)
|
||||
#define Movie_GetCurrentFrame ((int __cdecl (*)(LPVOID))0x00458D0C)
|
||||
#define Player_StartTimer ((int __cdecl (*)(LPVOID))0x00458D12)
|
||||
#define Player_InitMoviePlayback ((int __cdecl (*)(LPVOID, LPVOID, LPVOID))0x00458D18)
|
||||
#define Movie_SetSyncAdjust ((int __cdecl (*)(LPVOID, LPVOID, DWORD))0x00458D1E)
|
||||
#define Player_InitSound ((int __cdecl (*)(LPVOID, DWORD, DWORD, BOOL, DWORD, DWORD, DWORD, DWORD, DWORD))0x00458D24)
|
||||
#define Movie_GetSoundChannels ((int __cdecl (*)(LPVOID))0x00458D2A)
|
||||
#define Movie_GetSoundRate ((int __cdecl (*)(LPVOID))0x00458D30)
|
||||
#define Movie_GetSoundPrecision ((int __cdecl (*)(LPVOID))0x00458D36)
|
||||
#define Player_GetDSErrorCode ((int __cdecl (*)(void))0x00458D3C)
|
||||
#define Player_InitSoundSystem ((int __cdecl (*)(HWND))0x00458D42)
|
||||
#define Player_BlankScreen ((int __cdecl (*)(DWORD, DWORD, DWORD, DWORD))0x00458D48)
|
||||
#define Player_InitPlaybackMode ((int __cdecl (*)(HWND, LPVOID, DWORD, DWORD))0x00458D4E)
|
||||
#define Player_InitVideo ((int __cdecl (*)(LPVOID, LPVOID, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD))0x00458D54)
|
||||
#define Movie_GetXSize ((int __cdecl (*)(LPVOID))0x00458D5A)
|
||||
#define Movie_GetYSize ((int __cdecl (*)(LPVOID))0x00458D60)
|
||||
#define Movie_GetFormat ((int __cdecl (*)(LPVOID))0x00458D66)
|
||||
#define Player_InitMovie ((int __cdecl (*)(LPVOID, DWORD, DWORD, LPCTSTR, DWORD))0x00458D6C)
|
||||
#define Player_PassInDirectDrawObject ((int __cdecl (*)(LPDIRECTDRAW3))0x00458D72)
|
||||
#define Player_ReturnPlaybackMode ((int __cdecl (*)(BOOL))0x00458D78)
|
||||
#define Player_ShutDownSoundSystem ((int __cdecl (*)(void))0x00458D7E)
|
||||
#define Player_ShutDownMovie ((int __cdecl (*)(LPVOID))0x00458D84)
|
||||
#define Player_ShutDownVideo ((int __cdecl (*)(LPVOID))0x00458D8A)
|
||||
#define Player_ShutDownSound ((int __cdecl (*)(LPVOID))0x00458D90)
|
||||
#define Player_StopTimer ((int __cdecl (*)(LPVOID))0x00458D96)
|
||||
// clang-format on
|
||||
|
|
|
@ -234,7 +234,6 @@ static void M_DecompFMV(const bool enable)
|
|||
{
|
||||
INJECT(enable, 0x0044BDA0, PlayFMV);
|
||||
INJECT(enable, 0x0044C140, IntroFMV);
|
||||
INJECT(enable, 0x00449500, FmvBackToGame);
|
||||
INJECT(enable, 0x0044BE10, WinPlayFMV);
|
||||
INJECT(enable, 0x0044C0F0, WinStopFMV);
|
||||
INJECT(enable, 0x0044C450, S_PlayFMV);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue