Mercurial > mm7
changeset 2145:ad71de147333
Слияние
author | Ritor1 |
---|---|
date | Mon, 06 Jan 2014 19:29:59 +0600 |
parents | cfe04d858766 (current diff) feeb7bfcb19e (diff) |
children | 6ed6ad15995d |
files | Events.cpp Outdoor.cpp |
diffstat | 11 files changed, 682 insertions(+), 317 deletions(-) [+] |
line wrap: on
line diff
--- a/Build/Visual Studio 2010/World of Might and Magic.vcxproj Mon Jan 06 19:29:01 2014 +0600 +++ b/Build/Visual Studio 2010/World of Might and Magic.vcxproj Mon Jan 06 19:29:59 2014 +0600 @@ -286,6 +286,72 @@ <ClInclude Include="..\..\lib\legacy_dx\rmxfguid.h" /> <ClInclude Include="..\..\lib\legacy_dx\rmxftmpl.h" /> <ClInclude Include="..\..\lib\legacy_dx\strsafe.h" /> + <ClInclude Include="..\..\lib\libavcodec\avcodec.h" /> + <ClInclude Include="..\..\lib\libavcodec\avfft.h" /> + <ClInclude Include="..\..\lib\libavcodec\dxva2.h" /> + <ClInclude Include="..\..\lib\libavcodec\old_codec_ids.h" /> + <ClInclude Include="..\..\lib\libavcodec\vaapi.h" /> + <ClInclude Include="..\..\lib\libavcodec\vda.h" /> + <ClInclude Include="..\..\lib\libavcodec\vdpau.h" /> + <ClInclude Include="..\..\lib\libavcodec\version.h" /> + <ClInclude Include="..\..\lib\libavcodec\xvmc.h" /> + <ClInclude Include="..\..\lib\libavformat\avformat.h" /> + <ClInclude Include="..\..\lib\libavformat\avio.h" /> + <ClInclude Include="..\..\lib\libavformat\version.h" /> + <ClInclude Include="..\..\lib\libavutil\adler32.h" /> + <ClInclude Include="..\..\lib\libavutil\aes.h" /> + <ClInclude Include="..\..\lib\libavutil\attributes.h" /> + <ClInclude Include="..\..\lib\libavutil\audioconvert.h" /> + <ClInclude Include="..\..\lib\libavutil\audio_fifo.h" /> + <ClInclude Include="..\..\lib\libavutil\avassert.h" /> + <ClInclude Include="..\..\lib\libavutil\avconfig.h" /> + <ClInclude Include="..\..\lib\libavutil\avstring.h" /> + <ClInclude Include="..\..\lib\libavutil\avutil.h" /> + <ClInclude Include="..\..\lib\libavutil\base64.h" /> + <ClInclude Include="..\..\lib\libavutil\blowfish.h" /> + <ClInclude Include="..\..\lib\libavutil\bprint.h" /> + <ClInclude Include="..\..\lib\libavutil\bswap.h" /> + <ClInclude Include="..\..\lib\libavutil\buffer.h" /> + <ClInclude Include="..\..\lib\libavutil\channel_layout.h" /> + <ClInclude Include="..\..\lib\libavutil\common.h" /> + <ClInclude Include="..\..\lib\libavutil\cpu.h" /> + <ClInclude Include="..\..\lib\libavutil\crc.h" /> + <ClInclude Include="..\..\lib\libavutil\dict.h" /> + <ClInclude Include="..\..\lib\libavutil\error.h" /> + <ClInclude Include="..\..\lib\libavutil\eval.h" /> + <ClInclude Include="..\..\lib\libavutil\fifo.h" /> + <ClInclude Include="..\..\lib\libavutil\file.h" /> + <ClInclude Include="..\..\lib\libavutil\frame.h" /> + <ClInclude Include="..\..\lib\libavutil\hmac.h" /> + <ClInclude Include="..\..\lib\libavutil\imgutils.h" /> + <ClInclude Include="..\..\lib\libavutil\intfloat.h" /> + <ClInclude Include="..\..\lib\libavutil\intfloat_readwrite.h" /> + <ClInclude Include="..\..\lib\libavutil\intreadwrite.h" /> + <ClInclude Include="..\..\lib\libavutil\lfg.h" /> + <ClInclude Include="..\..\lib\libavutil\log.h" /> + <ClInclude Include="..\..\lib\libavutil\lzo.h" /> + <ClInclude Include="..\..\lib\libavutil\mathematics.h" /> + <ClInclude Include="..\..\lib\libavutil\md5.h" /> + <ClInclude Include="..\..\lib\libavutil\mem.h" /> + <ClInclude Include="..\..\lib\libavutil\murmur3.h" /> + <ClInclude Include="..\..\lib\libavutil\old_pix_fmts.h" /> + <ClInclude Include="..\..\lib\libavutil\opt.h" /> + <ClInclude Include="..\..\lib\libavutil\parseutils.h" /> + <ClInclude Include="..\..\lib\libavutil\pixdesc.h" /> + <ClInclude Include="..\..\lib\libavutil\pixfmt.h" /> + <ClInclude Include="..\..\lib\libavutil\random_seed.h" /> + <ClInclude Include="..\..\lib\libavutil\rational.h" /> + <ClInclude Include="..\..\lib\libavutil\samplefmt.h" /> + <ClInclude Include="..\..\lib\libavutil\sha.h" /> + <ClInclude Include="..\..\lib\libavutil\time.h" /> + <ClInclude Include="..\..\lib\libavutil\timecode.h" /> + <ClInclude Include="..\..\lib\libavutil\timestamp.h" /> + <ClInclude Include="..\..\lib\libavutil\version.h" /> + <ClInclude Include="..\..\lib\libavutil\xtea.h" /> + <ClInclude Include="..\..\lib\libswresample\swresample.h" /> + <ClInclude Include="..\..\lib\libswresample\version.h" /> + <ClInclude Include="..\..\lib\libswscale\swscale.h" /> + <ClInclude Include="..\..\lib\libswscale\version.h" /> <ClInclude Include="..\..\lib\lua\lua-5.2.2\lapi.h" /> <ClInclude Include="..\..\lib\lua\lua-5.2.2\lauxlib.h" /> <ClInclude Include="..\..\lib\lua\lua-5.2.2\lcode.h" /> @@ -311,6 +377,12 @@ <ClInclude Include="..\..\lib\lua\lua-5.2.2\lvm.h" /> <ClInclude Include="..\..\lib\lua\lua-5.2.2\lzio.h" /> <ClInclude Include="..\..\lib\lua\lua.h" /> + <ClInclude Include="..\..\lib\OpenAL\al.h" /> + <ClInclude Include="..\..\lib\OpenAL\alc.h" /> + <ClInclude Include="..\..\lib\OpenAL\efx-creative.h" /> + <ClInclude Include="..\..\lib\OpenAL\EFX-Util.h" /> + <ClInclude Include="..\..\lib\OpenAL\efx.h" /> + <ClInclude Include="..\..\lib\OpenAL\xram.h" /> <ClInclude Include="..\..\lib\zlib\deflate.h" /> <ClInclude Include="..\..\lib\zlib\infblock.h" /> <ClInclude Include="..\..\lib\zlib\infcodes.h" /> @@ -383,6 +455,14 @@ </ItemGroup> <ItemGroup> <None Include="..\..\lib\legacy_dx\d3dvec.inl" /> + <None Include="..\..\lib\OpenAL\lib\x86\avcodec-55.def" /> + <None Include="..\..\lib\OpenAL\lib\x86\avdevice-55.def" /> + <None Include="..\..\lib\OpenAL\lib\x86\avfilter-3.def" /> + <None Include="..\..\lib\OpenAL\lib\x86\avformat-55.def" /> + <None Include="..\..\lib\OpenAL\lib\x86\avutil-52.def" /> + <None Include="..\..\lib\OpenAL\lib\x86\postproc-52.def" /> + <None Include="..\..\lib\OpenAL\lib\x86\swresample-0.def" /> + <None Include="..\..\lib\OpenAL\lib\x86\swscale-2.def" /> <None Include="..\..\lib\swig.bat" /> <CustomBuild Include="..\..\NewUI\Core\UIControlModule.swig"> <FileType>Document</FileType> @@ -392,6 +472,17 @@ <None Include="..\..\lib\swig\swigwin-2.0.11\UIControlModule.swig" /> <None Include="..\..\Player.swig" /> </ItemGroup> + <ItemGroup> + <Library Include="..\..\lib\OpenAL\lib\OpenAL\OpenAL32.lib" /> + <Library Include="..\..\lib\OpenAL\lib\x86\avcodec.lib" /> + <Library Include="..\..\lib\OpenAL\lib\x86\avdevice.lib" /> + <Library Include="..\..\lib\OpenAL\lib\x86\avfilter.lib" /> + <Library Include="..\..\lib\OpenAL\lib\x86\avformat.lib" /> + <Library Include="..\..\lib\OpenAL\lib\x86\avutil.lib" /> + <Library Include="..\..\lib\OpenAL\lib\x86\postproc.lib" /> + <Library Include="..\..\lib\OpenAL\lib\x86\swresample.lib" /> + <Library Include="..\..\lib\OpenAL\lib\x86\swscale.lib" /> + </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> </ImportGroup>
--- a/Build/Visual Studio 2010/World of Might and Magic.vcxproj.filters Mon Jan 06 19:29:01 2014 +0600 +++ b/Build/Visual Studio 2010/World of Might and Magic.vcxproj.filters Mon Jan 06 19:29:59 2014 +0600 @@ -286,6 +286,222 @@ </ClInclude> <ClInclude Include="..\..\Timer.h" /> <ClInclude Include="..\..\LuaVM.h" /> + <ClInclude Include="..\..\lib\libavcodec\avcodec.h"> + <Filter>lib\libavcodec</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavcodec\avfft.h"> + <Filter>lib\libavcodec</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavcodec\dxva2.h"> + <Filter>lib\libavcodec</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavcodec\old_codec_ids.h"> + <Filter>lib\libavcodec</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavcodec\vaapi.h"> + <Filter>lib\libavcodec</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavcodec\vda.h"> + <Filter>lib\libavcodec</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavcodec\vdpau.h"> + <Filter>lib\libavcodec</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavcodec\version.h"> + <Filter>lib\libavcodec</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavcodec\xvmc.h"> + <Filter>lib\libavcodec</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavformat\avformat.h"> + <Filter>lib\libavformat</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavformat\avio.h"> + <Filter>lib\libavformat</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavformat\version.h"> + <Filter>lib\libavformat</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\adler32.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\aes.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\attributes.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\audio_fifo.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\audioconvert.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\avassert.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\avconfig.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\avstring.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\avutil.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\base64.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\blowfish.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\bprint.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\bswap.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\buffer.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\channel_layout.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\common.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\cpu.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\crc.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\dict.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\error.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\eval.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\fifo.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\file.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\frame.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\hmac.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\imgutils.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\intfloat.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\intfloat_readwrite.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\intreadwrite.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\lfg.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\log.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\lzo.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\mathematics.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\md5.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\mem.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\murmur3.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\old_pix_fmts.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\opt.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\parseutils.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\pixdesc.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\pixfmt.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\random_seed.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\rational.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\samplefmt.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\sha.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\time.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\timecode.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\timestamp.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\version.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libavutil\xtea.h"> + <Filter>lib\libavutil</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libswresample\swresample.h"> + <Filter>lib\libswresample</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libswresample\version.h"> + <Filter>lib\libswresample</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libswscale\swscale.h"> + <Filter>lib\libswscale</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\libswscale\version.h"> + <Filter>lib\libswscale</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\OpenAL\al.h"> + <Filter>lib\OpenAL</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\OpenAL\alc.h"> + <Filter>lib\OpenAL</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\OpenAL\efx.h"> + <Filter>lib\OpenAL</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\OpenAL\efx-creative.h"> + <Filter>lib\OpenAL</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\OpenAL\EFX-Util.h"> + <Filter>lib\OpenAL</Filter> + </ClInclude> + <ClInclude Include="..\..\lib\OpenAL\xram.h"> + <Filter>lib\OpenAL</Filter> + </ClInclude> </ItemGroup> <ItemGroup> <Filter Include="lib"> @@ -324,6 +540,33 @@ <Filter Include="lib\swig\swigwin-2.0.11"> <UniqueIdentifier>{cb1041ae-addb-49d8-9ec1-ffe52d29ae64}</UniqueIdentifier> </Filter> + <Filter Include="lib\libavcodec"> + <UniqueIdentifier>{00ba7ef3-081e-46d7-b651-f41dde1d3ff8}</UniqueIdentifier> + </Filter> + <Filter Include="lib\libavformat"> + <UniqueIdentifier>{297ce683-6a2f-4d6b-b4ae-10cc59f75ebc}</UniqueIdentifier> + </Filter> + <Filter Include="lib\libavutil"> + <UniqueIdentifier>{22b53a53-f99c-40ac-82fd-647f5012b96a}</UniqueIdentifier> + </Filter> + <Filter Include="lib\libswresample"> + <UniqueIdentifier>{1d0988f5-957a-4c5b-b76a-d1f57a7ac8d4}</UniqueIdentifier> + </Filter> + <Filter Include="lib\libswscale"> + <UniqueIdentifier>{10d851fd-bca4-46a3-9377-0a3ae5f6e9df}</UniqueIdentifier> + </Filter> + <Filter Include="lib\OpenAL"> + <UniqueIdentifier>{afaf8737-a450-48fc-91ad-a5f55625d40a}</UniqueIdentifier> + </Filter> + <Filter Include="lib\OpenAL\lib"> + <UniqueIdentifier>{bfeab783-b0c1-4ad6-937d-e0914f011587}</UniqueIdentifier> + </Filter> + <Filter Include="lib\OpenAL\lib\OpenAL"> + <UniqueIdentifier>{009e95ff-193d-47cc-9e52-e74b803c7aac}</UniqueIdentifier> + </Filter> + <Filter Include="lib\OpenAL\lib\x86"> + <UniqueIdentifier>{a28acffc-17d1-41fd-a206-c4c035a4e7b3}</UniqueIdentifier> + </Filter> </ItemGroup> <ItemGroup> <None Include="..\..\lib\legacy_dx\d3dvec.inl"> @@ -336,6 +579,30 @@ <Filter>lib\swig\swigwin-2.0.11</Filter> </None> <None Include="..\..\Player.swig" /> + <None Include="..\..\lib\OpenAL\lib\x86\avcodec-55.def"> + <Filter>lib\OpenAL\lib\x86</Filter> + </None> + <None Include="..\..\lib\OpenAL\lib\x86\avdevice-55.def"> + <Filter>lib\OpenAL\lib\x86</Filter> + </None> + <None Include="..\..\lib\OpenAL\lib\x86\avfilter-3.def"> + <Filter>lib\OpenAL\lib\x86</Filter> + </None> + <None Include="..\..\lib\OpenAL\lib\x86\avformat-55.def"> + <Filter>lib\OpenAL\lib\x86</Filter> + </None> + <None Include="..\..\lib\OpenAL\lib\x86\avutil-52.def"> + <Filter>lib\OpenAL\lib\x86</Filter> + </None> + <None Include="..\..\lib\OpenAL\lib\x86\postproc-52.def"> + <Filter>lib\OpenAL\lib\x86</Filter> + </None> + <None Include="..\..\lib\OpenAL\lib\x86\swresample-0.def"> + <Filter>lib\OpenAL\lib\x86</Filter> + </None> + <None Include="..\..\lib\OpenAL\lib\x86\swscale-2.def"> + <Filter>lib\OpenAL\lib\x86</Filter> + </None> </ItemGroup> <ItemGroup> <ClCompile Include="..\..\Actor.cpp" /> @@ -615,4 +882,33 @@ <Filter>NewUI\Core</Filter> </CustomBuild> </ItemGroup> + <ItemGroup> + <Library Include="..\..\lib\OpenAL\lib\OpenAL\OpenAL32.lib"> + <Filter>lib\OpenAL\lib\OpenAL</Filter> + </Library> + <Library Include="..\..\lib\OpenAL\lib\x86\avcodec.lib"> + <Filter>lib\OpenAL\lib\x86</Filter> + </Library> + <Library Include="..\..\lib\OpenAL\lib\x86\avdevice.lib"> + <Filter>lib\OpenAL\lib\x86</Filter> + </Library> + <Library Include="..\..\lib\OpenAL\lib\x86\avfilter.lib"> + <Filter>lib\OpenAL\lib\x86</Filter> + </Library> + <Library Include="..\..\lib\OpenAL\lib\x86\avformat.lib"> + <Filter>lib\OpenAL\lib\x86</Filter> + </Library> + <Library Include="..\..\lib\OpenAL\lib\x86\avutil.lib"> + <Filter>lib\OpenAL\lib\x86</Filter> + </Library> + <Library Include="..\..\lib\OpenAL\lib\x86\postproc.lib"> + <Filter>lib\OpenAL\lib\x86</Filter> + </Library> + <Library Include="..\..\lib\OpenAL\lib\x86\swresample.lib"> + <Filter>lib\OpenAL\lib\x86</Filter> + </Library> + <Library Include="..\..\lib\OpenAL\lib\x86\swscale.lib"> + <Filter>lib\OpenAL\lib\x86</Filter> + </Library> + </ItemGroup> </Project> \ No newline at end of file
--- a/CShow.h Mon Jan 06 19:29:01 2014 +0600 +++ b/CShow.h Mon Jan 06 19:29:59 2014 +0600 @@ -23,13 +23,13 @@ switch (movie) { - case MOVIE_3DOLogo: VideoPlayer::MovieLoop("3dologo", 0, 0, 1); break; - case MOVIE_NWCLogo: VideoPlayer::MovieLoop("new world logo", 0, 1, 1); break; - case MOVIE_JVC: VideoPlayer::MovieLoop("jvc", 0, 1, 1); break; - case MOVIE_Intro: VideoPlayer::MovieLoop("Intro", 0, 1, 1); break; - case MOVIE_Emerald: VideoPlayer::MovieLoop("Intro Post", 0, 1, 1); break; - case MOVIE_Death: VideoPlayer::MovieLoop("losegame", 2, 1, 1); break; - case MOVIE_Outro: VideoPlayer::MovieLoop("end_seq1", 20, 1, 1); break; + case MOVIE_3DOLogo: pVideoPlayer->MovieLoop("3dologo", 0, 0, 1); break; + case MOVIE_NWCLogo: pVideoPlayer->MovieLoop("new world logo", 0, 1, 1); break; + case MOVIE_JVC: pVideoPlayer->MovieLoop("jvc", 0, 1, 1); break; + case MOVIE_Intro: pVideoPlayer->MovieLoop("Intro", 0, 1, 1); break; + case MOVIE_Emerald: pVideoPlayer->MovieLoop("Intro Post", 0, 1, 1); break; + case MOVIE_Death: pVideoPlayer->MovieLoop("losegame", 2, 1, 1); break; + case MOVIE_Outro: pVideoPlayer->MovieLoop("end_seq1", 20, 1, 1); break; default: Error("Invalid movie requested: %u", movie);
--- a/Events.cpp Mon Jan 06 19:29:01 2014 +0600 +++ b/Events.cpp Mon Jan 06 19:29:59 2014 +0600 @@ -508,7 +508,7 @@ v15 = _evt->v6; strcpy(Str, Source); v16 = RemoveQuotes(Str); - VideoPlayer::MovieLoop(v16, 0, v14, 1); + pVideoPlayer->MovieLoop(v16, 0, v14, 1); if ( !_stricmp(v16, "arbiter good") ) { pParty->alignment = PartyAlignment_Good;
--- a/Game.cpp Mon Jan 06 19:29:01 2014 +0600 +++ b/Game.cpp Mon Jan 06 19:29:59 2014 +0600 @@ -168,7 +168,7 @@ GameUI_Footer_2(); viewparams->bRedrawGameUI = false; } - if (!pVideoPlayer->pSmackerMovie) + if (!pVideoPlayer->pMovie)//!pVideoPlayer->pSmackerMovie) { GameUI_DrawMinimap(488, 16, 625, 133, viewparams->uMinimapZoom, true);//redraw = pParty->uFlags & 2); if (v4) @@ -4591,8 +4591,8 @@ } if ( GetCurrentMenuID() == MENU_CREDITSPROC && !pCurrentScreen ) { - if ( pCurrentScreen == SCREEN_VIDEO ) - pVideoPlayer->FastForwardToFrame(pVideoPlayer->pResetflag); + //if ( pCurrentScreen == SCREEN_VIDEO ) + //pVideoPlayer->FastForwardToFrame(pVideoPlayer->pResetflag); if (GetCurrentMenuID() == MENU_NAMEPANELESC) { SetCurrentMenuID(MENU_CREATEPARTY);
--- a/OSWindow.cpp Mon Jan 06 19:29:01 2014 +0600 +++ b/OSWindow.cpp Mon Jan 06 19:29:59 2014 +0600 @@ -76,8 +76,8 @@ case WM_SIZING: return *result = 1, true; case WM_WINDOWPOSCHANGED: - if (pVideoPlayer && pVideoPlayer->AnyMovieLoaded() && pVideoPlayer->pBinkBuffer) - BinkBufferSetOffset(pVideoPlayer->pBinkBuffer, 0, 0); + //if (pVideoPlayer && pVideoPlayer->AnyMovieLoaded() && pVideoPlayer->pBinkBuffer) + //BinkBufferSetOffset(pVideoPlayer->pBinkBuffer, 0, 0); return false; case WM_CHAR: @@ -301,14 +301,14 @@ pMiscTimer->Resume(); viewparams->bRedrawGameUI = true; - if ( pVideoPlayer->pSmackerMovie ) + if ( pVideoPlayer->pMovie)//pVideoPlayer->pSmackerMovie ) { pRenderer->RestoreFrontBuffer(); pRenderer->_4A184C(); - pVideoPlayer->_4BF5B2(); + //pVideoPlayer->_4BF5B2(); } } - if ( pAudioPlayer->hAILRedbook && !bGameoverLoop && !pVideoPlayer->pSmackerMovie ) + if ( pAudioPlayer->hAILRedbook && !bGameoverLoop && !pVideoPlayer->pMovie)//!pVideoPlayer->pSmackerMovie ) AIL_redbook_resume(pAudioPlayer->hAILRedbook); } } @@ -317,7 +317,8 @@ if (!(dword_6BE364_game_settings_1 & GAME_SETTINGS_APP_INACTIVE)) { dword_4E98BC_bApplicationActive = 0; - if ( (pVideoPlayer->pSmackerMovie || pVideoPlayer->pBinkMovie) && pVideoPlayer->bPlayingMovie ) + if ( pVideoPlayer->pMovie//(pVideoPlayer->pSmackerMovie || pVideoPlayer->pBinkMovie) + && pVideoPlayer->bPlayingMovie ) pVideoPlayer->bStopBeforeSchedule = 1; if (/*pRenderer->bUserDirect3D && */pRenderer->uAcquiredDirect3DDevice == 1)
--- a/Outdoor.cpp Mon Jan 06 19:29:01 2014 +0600 +++ b/Outdoor.cpp Mon Jan 06 19:29:59 2014 +0600 @@ -1821,12 +1821,12 @@ for (uint i = 0; i < uNumBModels; ++i) { //v48 = 0; - BSPModel* model = &pBModels[i]; - - model->pVertices.pVertices = nullptr; - model->pFaces = nullptr; - model->pFacesOrdering = nullptr; - model->pNodes = nullptr; + //BSPModel* model = &pBModels[i]; + + pBModels[i].pVertices.pVertices = nullptr; + pBModels[i].pFaces = nullptr; + pBModels[i].pFacesOrdering = nullptr; + pBModels[i].pNodes = nullptr; //FileName[0] = 0; //v108 = (int)&pBModels[i]; //sprintf(FileName, "%s", v108); @@ -1837,35 +1837,35 @@ //v107 = 12 * v50->pVertices.uNumVertices; //v106 = (char *)v50->pVertices.pVertices; assert(sizeof(Vec3_int_) == 12); - uint verticesSize = model->pVertices.uNumVertices * sizeof(Vec3_int_); - model->pVertices.pVertices = (Vec3_int_ *)malloc(verticesSize); - memcpy(model->pVertices.pVertices, pSrc, verticesSize); + uint verticesSize = pBModels[i].pVertices.uNumVertices * sizeof(Vec3_int_); + pBModels[i].pVertices.pVertices = (Vec3_int_ *)malloc(verticesSize); + memcpy(pBModels[i].pVertices.pVertices, pSrc, verticesSize); pSrc += verticesSize; //v51 = &pBModels[v48]; //v108 = (int)FileName; //v107 = 308 * v51->uNumFaces; //v106 = (char *)v51->pFaces; assert(sizeof(ODMFace) == 308); - uint facesSize = model->uNumFaces * sizeof(ODMFace); - model->pFaces = (ODMFace *)malloc(facesSize); - memcpy(model->pFaces, pSrc, facesSize); + uint facesSize = pBModels[i].uNumFaces * sizeof(ODMFace); + pBModels[i].pFaces = (ODMFace *)malloc(facesSize); + memcpy(pBModels[i].pFaces, pSrc, facesSize); pSrc += facesSize; //v52 = &pBModels[v48]; //v108 = (int)FileName; //v107 = 2 * v52->uNumFaces; //v106 = (char *)v52->pFacesOrdering; - uint facesOrderingSize = model->uNumFaces * sizeof(short); - model->pFacesOrdering = (unsigned __int16 *)malloc(facesOrderingSize); - memcpy(model->pFacesOrdering, pSrc, facesOrderingSize); + uint facesOrderingSize = pBModels[i].uNumFaces * sizeof(short); + pBModels[i].pFacesOrdering = (unsigned __int16 *)malloc(facesOrderingSize); + memcpy(pBModels[i].pFacesOrdering, pSrc, facesOrderingSize); pSrc += facesOrderingSize; //v53 = &pBModels[v48]; //v108 = (int)FileName; //v107 = 8 * v53->uNumNodes; //v106 = (char *)v53->pNodes; assert(sizeof(BSPNode) == 8); - uint nodesSize = model->uNumNodes * sizeof(BSPNode); - model->pNodes = (BSPNode *)malloc(nodesSize); - memcpy(model->pNodes, pSrc, nodesSize); + uint nodesSize = pBModels[i].uNumNodes * sizeof(BSPNode); + pBModels[i].pNodes = (BSPNode *)malloc(nodesSize); + memcpy(pBModels[i].pNodes, pSrc, nodesSize); pSrc += nodesSize; //v54 = &pBModels[v48]; //v108 = 12 * v54->pVertices.uNumVertices; @@ -1892,50 +1892,50 @@ //memcpy(v59, uSourceLen, (size_t)pFilename); //uSourceLen = (char *)uSourceLen + (int)pFilename; //ptr = (FILE *)malloc(10 * model->uNumFaces); - const char* textureFilenames = (const char *)malloc(10 * model->uNumFaces); + const char* textureFilenames = (const char *)malloc(10 * pBModels[i].uNumFaces); //pFilename = (char *)(10 * pBModels[v48].uNumFaces); - memcpy((char *)textureFilenames, pSrc, 10 * model->uNumFaces); - pSrc += 10 * model->uNumFaces; + memcpy((char *)textureFilenames, pSrc, 10 * pBModels[i].uNumFaces); + pSrc += 10 * pBModels[i].uNumFaces; //v144 = 0; //uSourceLen = (char *)uSourceLen + (int)pFilename; //v60 = pBModels; - for (uint j = 0; j < model->uNumFaces; ++j) + for (uint j = 0; j < pBModels[i].uNumFaces; ++j) { const char* texFilename = &textureFilenames[j * 10]; //v149 = 0; //Str2 = (char *)ptr; - ODMFace* face = &model->pFaces[j]; + //ODMFace* face = &pBModels[i].pFaces[j]; //pFilename = (char *)v149 + (unsigned int)v60[v48].pFaces; - if (~face->uAttributes & FACE_DONT_CACHE_TEXTURE) + if ( !(pBModels[i].pFaces[j].uAttributes & FACE_DONT_CACHE_TEXTURE)) { v62 = pBitmaps_LOD->LoadTexture(texFilename); // v63 = (ODMFace *)pFilename; goto LABEL_68; } //v61 = pTextureFrameTable->FindTextureByName(texFilename); - face->uTextureID = pTextureFrameTable->FindTextureByName(texFilename); - if (!face->uTextureID) + pBModels[i].pFaces[j].uTextureID = pTextureFrameTable->FindTextureByName(texFilename); + if (!pBModels[i].pFaces[j].uTextureID) { v62 = pBitmaps_LOD->LoadTexture(texFilename); //v63 = (ODMFace *)pFilename; - face->uAttributes &= ~FACE_DONT_CACHE_TEXTURE; + pBModels[i].pFaces[j].uAttributes &= ~FACE_DONT_CACHE_TEXTURE; LABEL_68: - face->uTextureID = v62; + pBModels[i].pFaces[j].uTextureID = v62; //v145 = (signed __int16)v62 != -1 ? &pBitmaps_LOD->pTextures[(signed __int16)v62] : 0; //v108 = ((signed __int16)v62 != -1 ? pBitmaps_LOD->pTextures[(signed __int16)v62].palette_id1 : 36); if ((signed __int16)v62 != -1) pBitmaps_LOD->pTextures[v62].palette_id2 = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[v62].palette_id1); goto LABEL_69; } - pTextureFrameTable->LoadAnimationSequenceAndPalettes(face->uTextureID); + pTextureFrameTable->LoadAnimationSequenceAndPalettes(pBModels[i].pFaces[j].uTextureID); LABEL_69: - if (face->sCogTriggeredID) + if (pBModels[i].pFaces[j].sCogTriggeredID) { - if (face->HasEventHint()) - face->uAttributes |= 0x1000; + if (pBModels[i].pFaces[j].HasEventHint()) + pBModels[i].pFaces[j].uAttributes |= 0x100000; else - face->uAttributes &= ~0x1000; + pBModels[i].pFaces[j].uAttributes &= ~0x100000; } //++v144; //v60 = pBModels; @@ -1955,7 +1955,7 @@ //LABEL_75: pGameLoadingUI_ProgressBar->Progress(); - memcpy(&uNumLevelDecorations, pSrc, 4u); + memcpy(&uNumLevelDecorations, pSrc, 4); //uSourceLen = (char *)uSourceLen + 4; if (uNumLevelDecorations > 3000) MessageBoxW(nullptr, L"Can't load file!",
--- a/Render.cpp Mon Jan 06 19:29:01 2014 +0600 +++ b/Render.cpp Mon Jan 06 19:29:59 2014 +0600 @@ -9127,8 +9127,8 @@ && pCurrentScreen != SCREEN_NPC_DIALOGUE && pCurrentScreen != SCREEN_CHANGE_LOCATION ) { - if ( pCurrentScreen == SCREEN_INPUT_BLV ) - return pVideoPlayer->pSmackerMovie != 0; + if (pCurrentScreen == SCREEN_INPUT_BLV) + return pVideoPlayer->pMovie;//pSmackerMovie != 0; if ( pCurrentScreen != SCREEN_BRANCHLESS_NPC_DIALOG ) return true; }
--- a/VideoPlayer.cpp Mon Jan 06 19:29:01 2014 +0600 +++ b/VideoPlayer.cpp Mon Jan 06 19:29:59 2014 +0600 @@ -356,9 +356,9 @@ if ( a2 == 2 ) v4 = 0; ShowCursor(0); - pVideoPlayer->OpenGlobalMovie(pName, 0, ScreenSizeFlag); - pVideoPlayer->bPlayingMovie = 1; - pVideoPlayer->field_44 = v4; + OpenGlobalMovie(pName, 0, ScreenSizeFlag); + bPlayingMovie = 1; + field_44 = v4; if ( pRenderer->pRenderD3D ) { pRenderer->ClearTarget(0); @@ -397,13 +397,9 @@ } GUI_MainMenuMessageProc(); - if (!pVideoPlayer->mMovie) - { - pVideoPlayer->mMovie = pVideoPlayer->mPlayer->LoadMovie("dummyFilename", client_width, client_height); - } - else if (pVideoPlayer->mMovie->Stopped()) + if (pMovie->Stopped()) break; - auto image = pVideoPlayer->mPlayer->DoFrame(); + auto image = pPlayer->DoFrame(); if (image) { // draw to hwnd @@ -568,10 +564,12 @@ bStopBeforeSchedule = false; bBufferLoaded = 1; + /* pSmackerMovie = 0; pSmackerBuffer = 0; pBinkMovie = 0; pBinkBuffer = 0; + */ bPlayingMovie = false; bFirstFrame = false; bUsingSmackerMMX = SmackUseMMX(1); @@ -590,7 +588,7 @@ //_BINK *pBinkMovie; // eax@1 //_BINKBUF *pBinkBuffer; // eax@3 //_SMACK *pSmackerMovie; // eax@5 - + /* if ( pBinkMovie ) { //BinkPause(pBinkMovie, 1); @@ -618,6 +616,7 @@ SmackBufferClose(pSmackerBuffer); pSmackerBuffer = 0; } + */ if ( pSmackMovieBlit ) { SmackBlitClose(pSmackMovieBlit); @@ -631,14 +630,15 @@ AIL_redbook_resume(pAudioPlayer->hAILRedbook); pEventTimer->Resume(); - if (mMovie) + if (pMovie) { - delete mMovie; - mMovie = nullptr; + delete pMovie; + pMovie = nullptr; } } //----- (004BECD5) -------------------------------------------------------- +/* void VideoPlayer::FastForwardToFrame(unsigned int uDstFrameNum) { VideoPlayer *v2; // esi@1 @@ -859,10 +859,11 @@ Unload(); } } - +*/ void VideoPlayer::_inlined_in_463149() { - if ( mMovie )// && !SmackWait(pSmackerMovie) ) + /* + if ( pSmackMovie && !SmackWait(pSmackerMovie) ) { pRenderer->BeginScene(); pMouse->DrawCursorToTarget(); @@ -870,7 +871,7 @@ pMouse->_469EA4(); pRenderer->EndScene(); } - else if ( pBinkMovie )//&& !BinkWait(pBinkMovie) ) + else if ( pBinkMovie && !BinkWait(pBinkMovie) ) { pRenderer->BeginScene(); pMouse->DrawCursorToTarget(); @@ -878,9 +879,55 @@ pMouse->_469EA4(); pRenderer->EndScene(); } + */ + if (pMovie) + { + pRenderer->BeginScene(); + pMouse->DrawCursorToTarget(); + UpdatePalette(); + pMouse->_469EA4(); + pRenderer->EndScene(); + } } -auto pixels = new unsigned short[640 * 480]; +//auto pixels = new unsigned short[640 * 480]; + +void VideoPlayer::UpdatePalette() +{ + //VideoPlayer *v2; // esi@1 + unsigned __int16 *v3; // ebx@1 + unsigned int v4; // edi@1 + unsigned int v5; // eax@1 + //_SMACK *v6; // eax@1 + + Log::Warning(L"smacker"); + + pRenderer->BeginScene(); + + if (pMovie->Stopped()) + { + int width = pMovie->GetWidth(); + int height = pMovie->GetHeight(); + delete pMovie; + SetFilePointer(hVidFile, uOffset, nullptr, FILE_BEGIN); + + pMovie = pPlayer->LoadMovieFromLOD(hVidFile, &readFunction, &seekFunction, width, height); + } + else + { + + auto image = pPlayer->DoFrame(); + + if (image) + { + memcpy(pRenderer->pTargetSurface, image, 480 * 480 * 4); + delete[] image; + } + } + + pRenderer->EndScene(); +} +/* //----- (004BF08B) -------------------------------------------------------- void VideoPlayer::SmackUpdatePalette() { @@ -891,59 +938,26 @@ //_SMACK *v6; // eax@1 Log::Warning(L"smacker"); - //return; - + pRenderer->BeginScene(); v3 = pixels;//pRenderer->pTargetSurface; v4 = 640;//pRenderer->uTargetSurfacePitch; - //v5 = SmackCheckSurfaceFromat(); + v5 = SmackCheckSurfaceFromat(); - //SmackToBuffer(pSmackerMovie, 8, 8, 2 * v4, pRenderer->field_14, v3, v5); + SmackToBuffer(pSmackerMovie, 8, 8, 2 * v4, pRenderer->field_14, v3, v5); - /* + for (unsigned int y = 8; y < 8 + pSmackerMovie->Height; ++y) for (unsigned int x = 8; x < 8 + pSmackerMovie->Width; ++x) { pRenderer->WritePixel16(x, y, pixels[x + y * 640]); } //delete [] pixels; - */ + //v6 = pSmackerMovie; -// int i = 0; -// while (true) - //{ - - if (pVideoPlayer->mMovie->Stopped()) - { - //delete pVideoPlayer->mMovie; - //pVideoPlayer->mMovie = nullptr; - //Unload();//break; - pVideoPlayer->mPlayer->Rewind(); - } - else - { - - auto image = pVideoPlayer->mPlayer->DoFrame(); - - if (image) - { - memcpy(pRenderer->pTargetSurface, image, 480*480*4); - /*for (unsigned int y = 8; y < 8 + 360; ++y) - for (unsigned int x = 8; x < 8 + 480; ++x) - { - pRenderer->WritePixel16(x, y, image[y + x * 360]); - - }*/ - delete[] image; - } - } - - //delete pVideoPlayer->mMovie; - //pVideoPlayer->mMovie = nullptr; - //pVideoPlayer->Unload(); - - /* + while (true) + { if ( pSmackerMovie->NewPalette ) { SmackBufferNewPalette(pSmackerBuffer, pSmackerMovie->Palette, (pSmackerMovie->PalType)); @@ -959,15 +973,14 @@ SmackNextFrame(pSmackerMovie); else Unload(); - */ pRenderer->EndScene(); } +*/ - - +/* //----- (004BF141) -------------------------------------------------------- _BINK *VideoPlayer::OpenBink(const char *pName) { @@ -1030,7 +1043,7 @@ } return 0; } - +*/ //----- (004BF28F) -------------------------------------------------------- void VideoPlayer::OpenHouseMovie(const char *pMovieName, unsigned int a3_1) { @@ -1043,10 +1056,12 @@ bStopBeforeSchedule = false; bBufferLoaded = 1; + /* pSmackerMovie = 0; pSmackerBuffer = 0; pBinkMovie = 0; pBinkBuffer = 0; + */ bPlayingMovie = false; bFirstFrame = false; bUsingSmackerMMX = SmackUseMMX(1); @@ -1058,49 +1073,7 @@ return; } - sprintf(Str2, "%s.smk", pMovieName); - void *src = nullptr; - unsigned int *offset = nullptr; - for (uint i = 0; i < uNumMightVideoHeaders; ++i) - { - if (!_stricmp(Str2, pMightVideoHeaders[i].pVideoName)) - { - src = (void *)hMightVid; - offset = &pMightVideoHeaders[i].uFileOffset; - uVidFile = 0; - } - } - for (uint i = 0; i < uNumMagicVideoHeaders; ++i) - { - if (!_stricmp(Str2, pMagicVideoHeaders[i].pVideoName)) - { - src = (void *)hMagicVid; - offset = &pMagicVideoHeaders[i].uFileOffset; - uVidFile = 1; - } - } - if (!src) - { - Unload(); - MessageBoxA(0, "VideoPlayer error", "VideoPlayer Error", 0); - return; - } - - SetFilePointer(src, *offset, 0, FILE_BEGIN); - strcpy(this->pCurrentMovieName, pMovieName); - this->uMovieFormat = 1; - this->uMovieFormatSwapped = 2; - uSize = *(offset + sizeof(MovieHeader)) - *offset; - - - auto hwnd = pVideoPlayer->window->GetApiHandle(); - RECT rc_client; - GetClientRect(hwnd, &rc_client); - int client_width = rc_client.right - rc_client.left, - client_height = rc_client.bottom - rc_client.top; - - pVideoPlayer->mMovie = pVideoPlayer->mPlayer->LoadMovie("dummyFilename", client_width, client_height); - + LoadMovie(pMovieName); /* this->pSmackerMovie = OpenSmack(Str2); if ( !this->pSmackerMovie ) @@ -1131,15 +1104,13 @@ //----- (004BF3F9) -------------------------------------------------------- bool VideoPlayer::AnyMovieLoaded() { - return pSmackerMovie || pBinkMovie; + return pMovie;// pSmackerMovie || pBinkMovie; } //----- (004BF411) -------------------------------------------------------- void VideoPlayer::OpenGlobalMovie(const char *pFilename, unsigned int bLoop, int a4) { unsigned int v10; // eax@11 - char pVideoNameBik[120]; // [sp+Ch] [bp-28h]@2 - char pVideoNameSmk[120]; // [sp+Ch] [bp-28h]@2 if (!this->bBufferLoaded) { @@ -1150,70 +1121,17 @@ bStopBeforeSchedule = false; bBufferLoaded = 1; + /* pSmackerMovie = 0; pSmackerBuffer = 0; pBinkMovie = 0; pBinkBuffer = 0; + */ bPlayingMovie = false; bFirstFrame = false; bUsingSmackerMMX = SmackUseMMX(1); this->bLoopPlaying = bLoop; - - sprintf(pVideoNameBik, "%s.bik", pFilename); - sprintf(pVideoNameSmk, "%s.smk", pFilename); - void *src = nullptr; - unsigned int *offset = nullptr; - for (uint i = 0; i < uNumMightVideoHeaders; ++i) - { - //no BIK in MightVid - /* - if (!_stricmp(pVideoNameBik, pMightVideoHeaders[i].pVideoName)) - { - src = (void *)hMightVid; - offset = pMightVideoHeaders[i].uFileOffset; - uVidFile = 1; - this->uMovieFormat = 2; - this->uMovieFormatSwapped = 1; - } - */ - if (!_stricmp(pVideoNameSmk, pMightVideoHeaders[i].pVideoName)) - { - src = (void *)hMightVid; - offset = &pMightVideoHeaders[i].uFileOffset; - uVidFile = 0; - this->uMovieFormat = 1; - this->uMovieFormatSwapped = 2; - } - } - for (uint i = 0; i < uNumMagicVideoHeaders; ++i) - { - if (!_stricmp(pVideoNameBik, pMagicVideoHeaders[i].pVideoName)) - { - src = (void *)hMagicVid; - offset = &pMagicVideoHeaders[i].uFileOffset; - uVidFile = 1; - this->uMovieFormat = 2; - this->uMovieFormatSwapped = 1; - } - if (!_stricmp(pVideoNameSmk, pMagicVideoHeaders[i].pVideoName)) - { - src = (void *)hMagicVid; - offset = &pMagicVideoHeaders[i].uFileOffset; - uVidFile = 1; - this->uMovieFormat = 1; - this->uMovieFormatSwapped = 2; - } - } - if (!src) - { - Unload(); - MessageBoxA(0, "VideoPlayer error", "VideoPlayer Error", 0); - return; - } - - SetFilePointer(src, *offset, 0, FILE_BEGIN); - strcpy(this->pCurrentMovieName, pFilename); - uSize = *(offset+sizeof(MovieHeader))-*offset; + LoadMovie(pFilename); return; @@ -1281,7 +1199,9 @@ //----- (004BF5B2) -------------------------------------------------------- void VideoPlayer::_4BF5B2() { - if ( this->uMovieFormat == 2 ) + //__debugbreak(); + + /*if ( this->uMovieFormat == 2 ) { BinkGoto(pBinkMovie, 1, 0); BinkDoFrame(pBinkMovie); @@ -1297,9 +1217,9 @@ SmackDoFrame(pSmackerMovie); SmackNextFrame(pSmackerMovie); } - } + }*/ pMouse->_469E24(); - if ( window_SpeakInHouse && window_SpeakInHouse->ptr_1C == (void *)165 && !this->pSmackerMovie ) + if ( window_SpeakInHouse && window_SpeakInHouse->ptr_1C == (void *)165 && !this->pMovie)//!this->pSmackerMovie ) { bGameoverLoop = 1; HouseDialogPressCloseBtn(); @@ -1316,6 +1236,7 @@ } bGameoverLoop = 0; } + } //----- (004BF73A) -------------------------------------------------------- @@ -1345,16 +1266,17 @@ //----- (004BE6F5) -------------------------------------------------------- VideoPlayer::VideoPlayer() : bBufferLoaded(0), - pBinkMovie(nullptr), pBinkBuffer(nullptr), - pSmackerMovie(nullptr), pSmackerBuffer(nullptr), pSmackMovieBlit(nullptr) + //pBinkMovie(nullptr), pBinkBuffer(nullptr), + //pSmackerMovie(nullptr), pSmackerBuffer(nullptr), + pSmackMovieBlit(nullptr) { //RGBTexture::RGBTexture(&pVideoPlayer->pVideoFrame); bStopBeforeSchedule = false; pResetflag = 0; byte_F8BC0C = 0; - mPlayer = new MultimediaPlayer(); - mPlayer->Initialize(); - mMovie = nullptr; + pPlayer = new MultimediaPlayer(); + pPlayer->Initialize(); + pMovie = nullptr; //pBinkMovie = nullptr; } @@ -1369,7 +1291,7 @@ WriteConsoleA(GetStdHandle(STD_OUTPUT_HANDLE), msg, lstrlenA(msg), &w, nullptr); } -int readFunction(void* opaque, uint8_t* buf, int buf_size) +int VideoPlayer::readFunction(void* opaque, uint8_t* buf, int buf_size) { HANDLE stream = (HANDLE)opaque; //int numBytes = stream->read((char*)buf, buf_size); @@ -1378,20 +1300,84 @@ return numBytes; } -int64_t seekFunction(void* opaque, int64_t offset, int whence) +int64_t VideoPlayer::seekFunction(void* opaque, int64_t offset, int whence) { if (whence == AVSEEK_SIZE) - return pVideoPlayer->uSize;// -1; // I don't know "size of my handle in bytes" - HANDLE stream = (HANDLE)opaque; - /*if (stream->isSequential()) - return -1; // cannot seek a sequential stream - if (!stream->seek(offset)) - return -1; - return stream->pos();*/ - LARGE_INTEGER li,li2; - PLARGE_INTEGER pli = &li2; + return pVideoPlayer->uSize; + HANDLE h = (HANDLE)opaque; + LARGE_INTEGER li; li.QuadPart = offset; - SetFilePointerEx(stream, li, pli, FILE_BEGIN); - return pli->QuadPart; - return SetFilePointer(stream, LODWORD(offset), (PLONG)(&offset)+1, FILE_BEGIN); + + if (!SetFilePointerEx(h, li, (PLARGE_INTEGER)&li, FILE_BEGIN)) + return -1; + return li.QuadPart; } + +void VideoPlayer::LoadMovie(const char * pFilename) +{ + char pVideoNameBik[120]; // [sp+Ch] [bp-28h]@2 + char pVideoNameSmk[120]; // [sp+Ch] [bp-28h]@2 + + sprintf(pVideoNameBik, "%s.bik", pFilename); + sprintf(pVideoNameSmk, "%s.smk", pFilename); + for (uint i = 0; i < uNumMightVideoHeaders; ++i) + { + //no BIK in MightVid + /* + if (!_stricmp(pVideoNameBik, pMightVideoHeaders[i].pVideoName)) + { + hVidFile = hMightVid; + uOffset = pMightVideoHeaders[i].uFileOffset; + uSize = pMightVideoHeaders[i + 1].uFileOffset - uOffset; + this->uMovieFormat = 2; + this->uMovieFormatSwapped = 1; + } + */ + if (!_stricmp(pVideoNameSmk, pMightVideoHeaders[i].pVideoName)) + { + hVidFile = hMightVid; + uOffset = pMightVideoHeaders[i].uFileOffset; + uSize = pMightVideoHeaders[i + 1].uFileOffset - uOffset; + this->uMovieFormat = 1; + this->uMovieFormatSwapped = 2; + } + } + for (uint i = 0; i < uNumMagicVideoHeaders; ++i) + { + if (!_stricmp(pVideoNameBik, pMagicVideoHeaders[i].pVideoName)) + { + hVidFile = hMagicVid; + uOffset = pMagicVideoHeaders[i].uFileOffset; + uSize = pMagicVideoHeaders[i + 1].uFileOffset - uOffset; + this->uMovieFormat = 2; + this->uMovieFormatSwapped = 1; + } + if (!_stricmp(pVideoNameSmk, pMagicVideoHeaders[i].pVideoName)) + { + hVidFile = hMagicVid; + uOffset = pMagicVideoHeaders[i].uFileOffset; + uSize = pMagicVideoHeaders[i + 1].uFileOffset - uOffset; + this->uMovieFormat = 1; + this->uMovieFormatSwapped = 2; + } + } + if (!hVidFile) + { + Unload(); + MessageBoxA(0, "VideoPlayer error", "VideoPlayer Error", 0); + return; + } + + SetFilePointer(hVidFile, uOffset, 0, FILE_BEGIN); + strcpy(this->pCurrentMovieName, pFilename); + + auto hwnd = pVideoPlayer->window->GetApiHandle(); + RECT rc_client; + GetClientRect(hwnd, &rc_client); + int client_width = rc_client.right - rc_client.left, + client_height = rc_client.bottom - rc_client.top; + + + pMovie = pPlayer->LoadMovieFromLOD(hVidFile, &readFunction, &seekFunction, client_width, client_height); + +} \ No newline at end of file
--- a/VideoPlayer.h Mon Jan 06 19:29:01 2014 +0600 +++ b/VideoPlayer.h Mon Jan 06 19:29:59 2014 +0600 @@ -522,8 +522,13 @@ class MovieCached { public: - bool Stopped() const { return stopped; } - + bool Stopped() { return stopped; } + int GetWidth() { return width; } + int GetHeight() { return height; } + inline ~MovieCached() + { + Release(); + } protected: friend class MultimediaPlayer; inline MovieCached(OpenALSoundProvider *sound_provider) @@ -541,6 +546,23 @@ this->audio_stream = nullptr; this->audio_stream_dec = nullptr; this->audio_stream_dec_ctx = nullptr; + + packet = nullptr; + ioBuffer = nullptr; + format_ctx = nullptr; + avioContext = nullptr; + } + + bool LoadFromLOD(HANDLE h, int readFunction(void*, uint8_t*, int), int64_t seekFunction(void*, int64_t, int), int width, int height) + { + if (!ioBuffer) + ioBuffer = (unsigned char *)av_malloc(16384 + FF_INPUT_BUFFER_PADDING_SIZE); // can get av_free()ed by libav + if (!avioContext) + avioContext = avio_alloc_context(ioBuffer, 16384, 0, h, &readFunction, NULL, &seekFunction); + if (!format_ctx) + format_ctx = avformat_alloc_context(); + format_ctx->pb = avioContext; + return Load("dummyFilename", width, height); } bool Load(const char *video_filename, int width, int height) @@ -548,42 +570,12 @@ this->width = width; this->height = height; -/* for (uint i = 0; i < pVideoPlayer->uNumMagicVideoHeaders; ++i) - if (!_stricmp(video_filename, pVideoPlayer->pMagicVideoHeaders[i].pVideoName)) - { - SetFilePointer(pVideoPlayer->hMagicVid, pVideoPlayer->pMagicVideoHeaders[i].uFileOffset, 0, FILE_BEGIN); - break; - } -*/ packet = nullptr; - int ioBufferSize = 32768; - void *src; - - unsigned char * ioBuffer = (unsigned char *)av_malloc(ioBufferSize + FF_INPUT_BUFFER_PADDING_SIZE); // can get av_free()ed by libav - if (pVideoPlayer->uVidFile) - { - src = (void*)pVideoPlayer->hMagicVid; - } - else - { - src = (void*)pVideoPlayer->hMightVid; - } - - avioContext = avio_alloc_context(ioBuffer, ioBufferSize, 0, src, &readFunction, NULL, &seekFunction); - //offset = SetFilePointer(pVideoPlayer->hMagicVid,0,0,FILE_CURRENT); - LARGE_INTEGER li, li2; - PLARGE_INTEGER pli = &li2; - li.QuadPart = 0; - SetFilePointerEx(pVideoPlayer->hMagicVid, li, pli, FILE_CURRENT); - offset = pli->QuadPart; - - format_ctx = avformat_alloc_context(); - format_ctx->pb = avioContext; if (avformat_open_input(&format_ctx, video_filename, nullptr, nullptr) >= 0) { if (avformat_find_stream_info(format_ctx, nullptr) >= 0) { av_dump_format(format_ctx, 0, video_filename, 0); - + video_stream_idx = OpenStream(AVMEDIA_TYPE_VIDEO, &video_stream, &video_stream_dec, &video_stream_dec_ctx); if (video_stream_idx < 0) return Release(), false; @@ -603,11 +595,6 @@ bool Release() { - if (format_ctx) - { - avformat_free_context(format_ctx); - format_ctx = nullptr; - } if (packet) { av_free_packet(packet); @@ -630,6 +617,17 @@ audio_stream = nullptr; audio_stream_dec = nullptr; avcodec_close(audio_stream_dec_ctx); + + } + if (avioContext) + { + av_free(avioContext); + avioContext = nullptr; + } + if (format_ctx) + { + avformat_free_context(format_ctx); + format_ctx = nullptr; } return true; } @@ -657,27 +655,6 @@ return -1; } - void Rewind() - { - //auto i=avio_seek(avioContext, pVideoPlayer->uOffset, 0); - //auto i = av_seek_frame(format_ctx, -1, 0, AVSEEK_FLAG_BYTE); - //i = av_seek_frame(format_ctx, audio_stream_idx, 0, AVSEEK_FLAG_BYTE); - - int64_t timestamp = 9; - int ret, i; - if (format_ctx->start_time != AV_NOPTS_VALUE) - timestamp += format_ctx->start_time; - ret = av_seek_frame(format_ctx, -1, format_ctx->start_time, AVSEEK_FLAG_BYTE); - if (ret < 0) { -// av_log(ctx, AV_LOG_ERROR, "Unable to loop: %s\n", av_err2str(ret)); - //loop_count = 1; /* do not try again */ - return;// ret; - } - - - stopped = false; - } - MultimediaFrame::Ptr GetNextFrame() { packet->data = nullptr; @@ -722,8 +699,8 @@ AVStream *audio_stream; AVCodec *audio_stream_dec; AVCodecContext *audio_stream_dec_ctx; - AVIOContext * avioContext; - int64_t offset; + unsigned char * ioBuffer; + AVIOContext *avioContext; }; typedef MovieCached<10> Movie; @@ -754,6 +731,21 @@ return true; } + Movie *LoadMovieFromLOD(HANDLE h, int readFunction(void*, uint8_t*, int), int64_t seekFunction(void*, int64_t, int), int width, int height) + { + auto movie = new Movie(sound_provider); + if (movie) + { + if (movie->LoadFromLOD(h, readFunction, seekFunction, width, height)) + { + current_movie_width = width; + current_movie_height = height; + return current_movie = movie; + } + delete movie; + } + return nullptr; + } Movie *LoadMovie(const char *filename, int width, int height) { @@ -771,11 +763,6 @@ return nullptr; } - inline void Rewind() - { - current_movie->Rewind(); - } - inline char *DoFrame() { if (!current_movie) @@ -865,13 +852,13 @@ _BINKBUF *CreateBinkBuffer(unsigned int uWidth, unsigned int uHeight, char a4); void _inlined_in_463149(); - static void MovieLoop(const char *pMovieName, int a2, int a3, int a4); + void MovieLoop(const char *pMovieName, int a2, int a3, int a4); RGBTexture pVideoFrame; - struct _SMACK *pSmackerMovie; - struct _SMACKBUF *pSmackerBuffer; - char *pSomeSmackerBuffer; + //struct _SMACK *pSmackerMovie; + //struct _SMACKBUF *pSmackerBuffer; + //char *pSomeSmackerBuffer; int field_34; MovieHeader *pMightVideoHeaders; MovieHeader *pMagicVideoHeaders; @@ -892,19 +879,23 @@ struct _SMACKBLIT *pSmackMovieBlit; HANDLE hMightVid; HANDLE hMagicVid; - _BINK *pBinkMovie; - _BINKBUF *pBinkBuffer; + //_BINK *pBinkMovie; + //_BINKBUF *pBinkBuffer; char field_88[20]; unsigned int uMovieFormat; int uMovieFormatSwapped; char pCurrentMovieName[64]; char pVideoFrameTextureFilename[32]; int field_104; - MultimediaPlayer *mPlayer; - Movie *mMovie; - int uVidFile; + MultimediaPlayer *pPlayer; + Movie *pMovie; + HANDLE hVidFile; int uSize; int uOffset; + void UpdatePalette(); + static int readFunction(void *, uint8_t *, int); + static int64_t seekFunction(void *, int64_t, int); + void LoadMovie(const char *); }; #pragma pack(pop)
--- a/Vis.cpp Mon Jan 06 19:29:01 2014 +0600 +++ b/Vis.cpp Mon Jan 06 19:29:59 2014 +0600 @@ -1482,7 +1482,7 @@ if (filter->object_id != OBJECT_BLVDoor) return true; - if (no_event || face_attrib & filter->no_at_ai_state) + if (no_event || face_attrib & filter->no_at_ai_state)//face_attrib = 0x2009408 incorrect return false; return (face_attrib & filter->at_ai_state) != 0; } @@ -1687,12 +1687,12 @@ BSPModel* bmodel = &pOutdoor->pBModels[i]; for (uint j = 0; j < bmodel->uNumFaces; ++j) { - ODMFace* face = &bmodel->pFaces[j]; + //ODMFace* face = &bmodel->pFaces[j]; - if (is_part_of_selection(face, filter) ) + if (is_part_of_selection(&bmodel->pFaces[j], filter) ) { BLVFace blv_face; - blv_face.FromODM(face); + blv_face.FromODM(&bmodel->pFaces[j]); int pid = PID(OBJECT_BModel, j | (i << 6)); if (Vis_ObjectInfo* object_info = DetermineFacetIntersection(&blv_face, pid, pick_depth))