Mercurial > mm7
comparison VideoPlayer.cpp @ 2356:08c4f1799ca1
Elements of VideoPlayer structure moved
author | Ritor1 |
---|---|
date | Thu, 10 Apr 2014 17:34:50 +0600 |
parents | d57505d3c70c |
children | 5b9fb75b6f54 |
comparison
equal
deleted
inserted
replaced
2347:d57505d3c70c | 2356:08c4f1799ca1 |
---|---|
42 *pMinor = pInfo->dwFileVersionLS; | 42 *pMinor = pInfo->dwFileVersionLS; |
43 } | 43 } |
44 HeapFree(GetProcessHeap(), 0, pVersionData); | 44 HeapFree(GetProcessHeap(), 0, pVersionData); |
45 return true; | 45 return true; |
46 } | 46 } |
47 | |
48 unsigned __int64 uBinkVersion; | |
49 | 47 |
50 //----- (004BF794) -------------------------------------------------------- | 48 //----- (004BF794) -------------------------------------------------------- |
51 void ShowMM7IntroVideo_and_LoadingScreen() | 49 void ShowMM7IntroVideo_and_LoadingScreen() |
52 { | 50 { |
53 RGBTexture tex; // [sp+Ch] [bp-30h]@1 | 51 RGBTexture tex; // [sp+Ch] [bp-30h]@1 |
243 } | 241 } |
244 | 242 |
245 //----- (004BEBD7) -------------------------------------------------------- | 243 //----- (004BEBD7) -------------------------------------------------------- |
246 void VideoPlayer::Unload() | 244 void VideoPlayer::Unload() |
247 { | 245 { |
248 //_BINK *pBinkMovie; // eax@1 | |
249 //_BINKBUF *pBinkBuffer; // eax@3 | |
250 //_SMACK *pSmackerMovie; // eax@5 | |
251 /* | |
252 if ( pBinkMovie ) | |
253 { | |
254 //BinkPause(pBinkMovie, 1); | |
255 Sleep(300); | |
256 //BinkClose(pBinkMovie); | |
257 pBinkMovie = 0; | |
258 } | |
259 | |
260 if ( pBinkBuffer ) | |
261 { | |
262 pBinkBuffer->pTargetDDrawSurface->Release(); | |
263 pBinkBuffer->pTargetDDrawSurface = 0; | |
264 free(pBinkBuffer); | |
265 pBinkBuffer = 0; | |
266 } | |
267 | |
268 if ( pSmackerMovie ) | |
269 { | |
270 //SmackSoundOnOff(pSmackerMovie, 0); | |
271 //SmackClose(pSmackerMovie); | |
272 pSmackerMovie = 0; | |
273 } | |
274 if ( pSmackerBuffer ) | |
275 { | |
276 SmackBufferClose(pSmackerBuffer); | |
277 pSmackerBuffer = 0; | |
278 } | |
279 */ | |
280 if ( pSmackMovieBlit ) | 246 if ( pSmackMovieBlit ) |
281 { | 247 { |
282 SmackBlitClose(pSmackMovieBlit); | 248 SmackBlitClose(pSmackMovieBlit); |
283 pSmackMovieBlit = 0; | 249 pSmackMovieBlit = 0; |
284 } | 250 } |
307 pMouse->ReadCursorWithItem(); | 273 pMouse->ReadCursorWithItem(); |
308 pRenderer->EndScene(); | 274 pRenderer->EndScene(); |
309 } | 275 } |
310 } | 276 } |
311 | 277 |
312 void VideoPlayer::UpdatePalette() | 278 void VideoPlayer::UpdatePalette() //UpdateVideo |
313 { | 279 { |
314 Log::Warning(L"smacker"); | 280 Log::Warning(L"smacker"); |
315 loop_current_file = true; | 281 loop_current_file = true; |
316 pRenderer->BeginScene(); | 282 pRenderer->BeginScene(); |
317 /*if (pMovie->Stopped())//видео завершено/перезагрузка | 283 /*if (end_current_file)//видео завершено/перезагрузка |
318 { | 284 { |
319 int width = game_viewport_width; | 285 int width = game_viewport_width; |
320 int height = game_viewport_height; | 286 int height = game_viewport_height; |
321 delete pMovie; | 287 delete pMovie; |
322 | 288 |
432 SmackDoFrame(pSmackerMovie); | 398 SmackDoFrame(pSmackerMovie); |
433 SmackNextFrame(pSmackerMovie); | 399 SmackNextFrame(pSmackerMovie); |
434 } | 400 } |
435 }*/ | 401 }*/ |
436 pMouse->_469E24(); | 402 pMouse->_469E24(); |
437 if ( window_SpeakInHouse && window_SpeakInHouse->ptr_1C == (void *)165 && !this->pMovie)//!this->pSmackerMovie ) | 403 if ( window_SpeakInHouse && window_SpeakInHouse->ptr_1C == (void *)165 && !pMovie)//!this->pSmackerMovie ) |
438 { | 404 { |
439 bGameoverLoop = true; | 405 bGameoverLoop = true; |
440 HouseDialogPressCloseBtn(); | 406 HouseDialogPressCloseBtn(); |
441 window_SpeakInHouse->Release(); | 407 window_SpeakInHouse->Release(); |
442 pParty->uFlags &= 0xFFFFFFFD; | 408 pParty->uFlags &= 0xFFFFFFFD; |
485 pSmackMovieBlit(nullptr) | 451 pSmackMovieBlit(nullptr) |
486 { | 452 { |
487 //RGBTexture::RGBTexture(&pVideoPlayer->pVideoFrame); | 453 //RGBTexture::RGBTexture(&pVideoPlayer->pVideoFrame); |
488 bStopBeforeSchedule = false; | 454 bStopBeforeSchedule = false; |
489 pResetflag = 0; | 455 pResetflag = 0; |
490 //pPlayer = new MultimediaPlayer(); | 456 pMediaPlayer = new Media::MPlayer;//создаётся плеер |
491 //pPlayer->Initialize(); | |
492 pPlayer = new Media::Player;//создаётся плеер | |
493 pMovie = nullptr; | 457 pMovie = nullptr; |
494 //pBinkMovie = nullptr; | 458 //pBinkMovie = nullptr; |
495 } | 459 } |
496 | 460 |
497 int VideoPlayer::readFunction(void* opaque, uint8_t* buf, int buf_size) | 461 int VideoPlayer::readFunction(void* opaque, uint8_t* buf, int buf_size) |
523 | 487 |
524 sprintf(pVideoNameBik, "%s.bik", pFilename); | 488 sprintf(pVideoNameBik, "%s.bik", pFilename); |
525 sprintf(pVideoNameSmk, "%s.smk", pFilename); | 489 sprintf(pVideoNameSmk, "%s.smk", pFilename); |
526 for (uint i = 0; i < uNumMightVideoHeaders; ++i) | 490 for (uint i = 0; i < uNumMightVideoHeaders; ++i) |
527 { | 491 { |
528 //no BIK in MightVid | |
529 /* | |
530 if (!_stricmp(pVideoNameBik, pMightVideoHeaders[i].pVideoName)) | |
531 { | |
532 hVidFile = hMightVid; | |
533 uOffset = pMightVideoHeaders[i].uFileOffset; | |
534 uSize = pMightVideoHeaders[i + 1].uFileOffset - uOffset; | |
535 this->uMovieFormat = 2; | |
536 this->uMovieFormatSwapped = 1; | |
537 } | |
538 */ | |
539 if (!_stricmp(pVideoNameSmk, pMightVideoHeaders[i].pVideoName)) | 492 if (!_stricmp(pVideoNameSmk, pMightVideoHeaders[i].pVideoName)) |
540 { | 493 { |
541 hVidFile = hMightVid; | 494 hVidFile = hMightVid; |
542 uOffset = pMightVideoHeaders[i].uFileOffset; | 495 uOffset = pMightVideoHeaders[i].uFileOffset; |
543 uSize = pMightVideoHeaders[i + 1].uFileOffset - uOffset; | 496 uSize = pMightVideoHeaders[i + 1].uFileOffset - uOffset; |
579 GetClientRect(hwnd, &rc_client); | 532 GetClientRect(hwnd, &rc_client); |
580 int client_width = rc_client.right - rc_client.left, | 533 int client_width = rc_client.right - rc_client.left, |
581 client_height = rc_client.bottom - rc_client.top; | 534 client_height = rc_client.bottom - rc_client.top; |
582 | 535 |
583 | 536 |
584 pMovie = pPlayer->LoadMovieFromLOD(hVidFile, &readFunction, &seekFunction, client_width, client_height); | 537 pMovie = pMediaPlayer->LoadMovieFromLOD(hVidFile, &readFunction, &seekFunction, client_width, client_height); |
585 | 538 |
586 } | 539 } |
587 void VideoPlayer::PlayAudio(const wchar_t * pFilename) | |
588 { | |
589 Media::ITrack *track = pPlayer->LoadTrack(pFilename); | |
590 track->Play(); | |
591 } | |
592 void VideoPlayer::PlayMovie(const wchar_t * pFilename) | |
593 { | |
594 Media::IMovie *track = pPlayer->LoadMovie(pFilename, 640, 480, 0); | |
595 track->Play(); | |
596 } |