Mercurial > might-and-magic-trilogy
changeset 15:e33334611747
Merge
author | Nomad |
---|---|
date | Sat, 13 Oct 2012 17:10:23 +0200 |
parents | b47e9c80e741 (current diff) 17150bdf321e (diff) |
children | f810c4366a77 3fa5d0522f92 |
files | |
diffstat | 7 files changed, 56 insertions(+), 44 deletions(-) [+] |
line wrap: on
line diff
--- a/CShow.h Sat Oct 13 17:09:02 2012 +0200 +++ b/CShow.h Sat Oct 13 17:10:23 2012 +0200 @@ -11,8 +11,8 @@ MOVIE_3DOLogo = 0x1, MOVIE_NWCLogo = 0x2, MOVIE_JVC = 0x3, - MOVIE_Intro = 0x4, - MOVIE_Emerald = 0x5, + MOVIE_Emerald = 0x4, + MOVIE_Intro = 0x5, MOVIE_Death = 0x6, MOVIE_Outro = 0x7, }; @@ -32,10 +32,10 @@ void CShow::PlayMovie(MovieType eVideo, bool bShowMouseAfterPlayback) { int v3; // edx@5 - const char *v4; // ecx@5 + const char *Name; // ecx@5 std::string v5; // [sp-18h] [bp-24h]@4 signed int v6; // [sp-Ch] [bp-18h]@10 - int v7; // [sp-8h] [bp-14h]@4 + int ScreenSizeFlag; // [sp-8h] [bp-14h]@4 int v8; // [sp-4h] [bp-10h]@4 char v9; // [sp+0h] [bp-Ch]@14 char v10; // [sp+4h] [bp-8h]@4 @@ -50,49 +50,49 @@ break; case MOVIE_3DOLogo: v8 = 1; - v7 = 0; + ScreenSizeFlag = 0; v3 = 0; - v4 = "3dologo"; + Name = "3dologo"; goto LABEL_13; case MOVIE_NWCLogo: v8 = 1; - v7 = 1; + ScreenSizeFlag = 1; v3 = 0; - v4 = "new world logo"; + Name = "new world logo"; goto LABEL_13; case MOVIE_JVC: v8 = 1; - v7 = 1; + ScreenSizeFlag = 1; v3 = 0; - v4 = "jvc"; + Name = "jvc"; + goto LABEL_13; + case MOVIE_Intro: + v8 = 1; + ScreenSizeFlag = 1; + v3 = 0; + Name = "Intro"; goto LABEL_13; case MOVIE_Emerald: v8 = 1; - v7 = 1; + ScreenSizeFlag = 1; v3 = 0; - v4 = "Intro"; - goto LABEL_13; - case MOVIE_Intro: - v8 = 1; - v7 = 1; - v3 = 0; - v4 = "Intro Post"; + Name = "Intro Post"; goto LABEL_13; case MOVIE_Death: v8 = 1; - v7 = 1; + ScreenSizeFlag = 1; v6 = 2; - v4 = "losegame"; + Name = "losegame"; goto LABEL_12; case MOVIE_Outro: v8 = 1; - v7 = 1; + ScreenSizeFlag = 1; v6 = 20; - v4 = "end_seq1"; + Name = "end_seq1"; LABEL_12: v3 = v6; LABEL_13: - VideoPlayer::MovieLoop(v4, v3, v7, v8); + VideoPlayer::MovieLoop(Name, v3, ScreenSizeFlag, v8); break; default: MessageBoxW(nullptr, L"Invalid movie requested in CShow::Run()", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Show.cpp:72", 0);
--- a/Might and Magic Trilogy.vcxproj.filters Sat Oct 13 17:09:02 2012 +0200 +++ b/Might and Magic Trilogy.vcxproj.filters Sat Oct 13 17:10:23 2012 +0200 @@ -200,6 +200,7 @@ </ClInclude> <ClInclude Include="Log.h" /> <ClInclude Include="FrameTableInc.h" /> + <ClInclude Include="resource.h" /> </ItemGroup> <ItemGroup> <Filter Include="lib"> @@ -316,4 +317,7 @@ <ClCompile Include="mm7_6.cpp" /> <ClCompile Include="GameUIs.cpp" /> </ItemGroup> + <ItemGroup> + <ResourceCompile Include="Might and Magic Trilogy.rc" /> + </ItemGroup> </Project> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Might and Magic Trilogy.vcxproj.user Sat Oct 13 17:10:23 2012 +0200 @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <LocalDebuggerWorkingDirectory>..\Games\MM7</LocalDebuggerWorkingDirectory> + <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor> + <LocalDebuggerCommandArguments>-nocd</LocalDebuggerCommandArguments> + </PropertyGroup> +</Project> \ No newline at end of file
--- a/Render.cpp Sat Oct 13 17:09:02 2012 +0200 +++ b/Render.cpp Sat Oct 13 17:10:23 2012 +0200 @@ -6983,7 +6983,7 @@ int v7; // [sp-8h] [bp-8h]@3 unsigned int v8; // [sp-4h] [bp-4h]@3 - if ( pVersion->pVersionInfo.dwPlatformId != VER_PLATFORM_WIN32_NT || pVersion->pVersionInfo.dwMajorVersion != 4 ) + if ( pVersion->pVersionInfo.dwPlatformId != VER_PLATFORM_WIN32_NT || pVersion->pVersionInfo.dwMajorVersion >= 5u ) ErrD3D(pFrontBuffer4->Blt(pDstRect, (IDirectDrawSurface4 *)pSrcSurface, pSrcRect, uBltFlags, nullptr)); else ErrD3D(pFrontBuffer2->Blt(pDstRect, (IDirectDrawSurface2 *)pSrcSurface, pSrcRect, uBltFlags, nullptr));
--- a/VideoPlayer.cpp Sat Oct 13 17:09:02 2012 +0200 +++ b/VideoPlayer.cpp Sat Oct 13 17:10:23 2012 +0200 @@ -26,7 +26,7 @@ //----- (004BFE2D) -------------------------------------------------------- -_BINKBUF *VideoPlayer::CreateBinkBuffer(HWND a1, unsigned int uWidth, unsigned int uHeight, char a4) +_BINKBUF *VideoPlayer::CreateBinkBuffer(HWND hWindow, unsigned int uWidth, unsigned int uHeight, char a4) { __int32 v4; // edi@3 _BINKBUF *v5; // esi@3 @@ -43,13 +43,13 @@ HWND hWnd; // [sp+110h] [bp-4h]@1 v13 = uWidth; - hWnd = a1; - if ( pVersion->pVersionInfo.dwPlatformId != VER_PLATFORM_WIN32_NT || pVersion->pVersionInfo.dwMajorVersion != 4 ) + hWnd = hWindow; + if ( pVersion->pVersionInfo.dwPlatformId != VER_PLATFORM_WIN32_NT || pVersion->pVersionInfo.dwMajorVersion >= 5u ) { v4 = 0; v15 = 0; - v5 = (_BINKBUF *)malloc(0x7Cu); - memset(v5, 0, 0x7Cu); + v5 = (_BINKBUF *)malloc(0xA4u); + memset(v5, 0, 0xA4u); memset(&v11, 0, 0x7Cu); v11.dwSize = 124; v11.dwWidth = v13; @@ -78,8 +78,8 @@ { v4 = 0; a2 = 0; - v5 = (_BINKBUF *)malloc(0x7Cu); - memset(v5, 0, 0x7Cu); + v5 = (_BINKBUF *)malloc(0xA4u); + memset(v5, 0, 0xA4u); memset(&Dst, 0, 0x6Cu); Dst.dwSize = 108; Dst.dwWidth = v13; @@ -152,7 +152,7 @@ LPVOID v7; // eax@14 v1 = _this; - if ( pVersion->pVersionInfo.dwPlatformId != VER_PLATFORM_WIN32_NT || pVersion->pVersionInfo.dwMajorVersion != 4 ) + if ( pVersion->pVersionInfo.dwPlatformId != VER_PLATFORM_WIN32_NT || pVersion->pVersionInfo.dwMajorVersion >= 5u ) { DDSURFACEDESC2 v8; // [sp+Ch] [bp-7Ch]@4 if ( _this->pTargetDDrawSurface ) @@ -164,7 +164,7 @@ v6 = (IDirectDrawSurface4 *)v1->pTargetDDrawSurface; if ( !v6->Lock(0, &v8, 1u, 0) ) break; - BYTE3(v1->uBinkDDSurfaceType) |= 4u; + BYTE3(v1->uBinkDDSurfaceType) |= 0x80u; if ( v6->Restore() ) return 0; } @@ -216,7 +216,7 @@ v2->Unlock(0); v1->uDDrawSurfacePitch = 0; v1->pDDrawSurfaceData = 0; - BYTE3(v1->uBinkDDSurfaceType) &= 0xFBu; + BYTE3(v1->uBinkDDSurfaceType) &= 0x7Fu; } } @@ -245,7 +245,7 @@ { pGame->pCShow->PlayMovie(MOVIE_JVC, 1); if ( !pVideoPlayer->bStopBeforeSchedule ) - pGame->pCShow->PlayMovie(MOVIE_Emerald, 1); + pGame->pCShow->PlayMovie(MOVIE_Intro, 1); } } } @@ -480,7 +480,7 @@ v1->bFirstFrame = 0; v1->bUsingSmackerMMX = SmackUseMMX(1); BinkSetSoundSystem(BinkOpenMiles, pAudioPlayer->hDigDriver); - if ( pVersion->pVersionInfo.dwPlatformId != VER_PLATFORM_WIN32_NT || pVersion->pVersionInfo.dwMajorVersion != 4 ) + if ( pVersion->pVersionInfo.dwPlatformId != VER_PLATFORM_WIN32_NT || pVersion->pVersionInfo.dwMajorVersion >= 5u ) v2 = (IDirectDrawSurface*)pRenderer->pBackBuffer4; else v2 = (IDirectDrawSurface*)pRenderer->pBackBuffer2; @@ -638,7 +638,7 @@ a3a.right = v5->uWidth; a3a.bottom = v5->uHeight; pRenderer->BltToFront(&a1, v5->pTargetDDrawSurface, &a3a, 0x1000000u); - if ( v4->pBinkMovie->FrameRate != v4->pBinkMovie->Data1 - 1 || v4->bLoopPlaying ) + if ( v4->pBinkMovie->CurrentFrame != v4->pBinkMovie->Frame - 1 || v4->bLoopPlaying ) BinkNextFrame(v4->pBinkMovie); else Unload(); @@ -847,7 +847,7 @@ goto LABEL_5; } SetFilePointer(v2->hMightVid, v2->pMightVideoHeaders[v3].uFileOffset, 0, 0); - v9 = 0x82000000u; + v9 = 0x8800000u; v8 = v2->hMightVid; return BinkOpen(v8, v9); } @@ -864,7 +864,7 @@ return 0; } SetFilePointer(v2->hMagicVid, v2->pMagicVideoHeaders[v5].uFileOffset, 0, 0); - v9 = 0x82000000u; + v9 = 0x8800000u; v8 = v2->hMagicVid; return BinkOpen(v8, v9); } @@ -1004,7 +1004,7 @@ VideoPlayer *v4; // esi@1 _BINK *v5; // eax@2 _SMACK *v6; // eax@3 - _BINK *v7; // eax@5 + _BINK *pBinkMovie; // eax@5 _SMACK *v8; // eax@7 char *v9; // eax@7 unsigned int v10; // eax@11 @@ -1024,10 +1024,10 @@ { v4->uMovieFormat = 2; strcpy(v4->pCurrentMovieName, pFilename); - v7 = v4->pBinkMovie; + pBinkMovie = v4->pBinkMovie; v4->dword_0000A0 = 1; - if ( v7 ) - v4->pBinkBuffer = CreateBinkBuffer(v4->hWindow, v7->Width, v7->Height, 0); + if ( pBinkMovie ) + v4->pBinkBuffer = CreateBinkBuffer(v4->hWindow, pBinkMovie->Width, pBinkMovie->Height, 0); } else {