diff VideoPlayer.cpp @ 15:e33334611747

Merge
author Nomad
date Sat, 13 Oct 2012 17:10:23 +0200
parents 17150bdf321e
children 3fa5d0522f92
line wrap: on
line diff
--- 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
     {