Mercurial > mm7
comparison VideoPlayer.cpp @ 898:10fa7dad1391
DrawPaperdoll clean
author | Ritor1 |
---|---|
date | Mon, 15 Apr 2013 16:36:56 +0600 |
parents | dfd683c4f538 |
children | eac5af72b614 c45d51b3f4f4 |
comparison
equal
deleted
inserted
replaced
897:d3228f46ef68 | 898:10fa7dad1391 |
---|---|
11 #include "GUIWindow.h" | 11 #include "GUIWindow.h" |
12 #include "Allocator.h" | 12 #include "Allocator.h" |
13 #include "Time.h" | 13 #include "Time.h" |
14 #include "Log.h" | 14 #include "Log.h" |
15 #include "UIHouses.h" | 15 #include "UIHouses.h" |
16 #include "texts.h" | |
16 #include "MM7.h" | 17 #include "MM7.h" |
17 #include "mm7_data.h" | 18 #include "mm7_data.h" |
18 | 19 |
19 | 20 |
20 VideoPlayer *pVideoPlayer = nullptr; | 21 VideoPlayer *pVideoPlayer = nullptr; |
346 if ( !(dword_6BE364_game_settings_1 & 0x44) ) | 347 if ( !(dword_6BE364_game_settings_1 & 0x44) ) |
347 { | 348 { |
348 if ( a2 == 2 ) | 349 if ( a2 == 2 ) |
349 v4 = 0; | 350 v4 = 0; |
350 ShowCursor(0); | 351 ShowCursor(0); |
351 pVideoPlayer->OpenMovie(pName, 0, ScreenSizeFlag); | 352 pVideoPlayer->OpenGlobalMovie(pName, 0, ScreenSizeFlag); |
352 pVideoPlayer->bPlayingMovie = 1; | 353 pVideoPlayer->bPlayingMovie = 1; |
353 pVideoPlayer->field_44 = v4; | 354 pVideoPlayer->field_44 = v4; |
354 if ( pRenderer->pRenderD3D ) | 355 if ( pRenderer->pRenderD3D ) |
355 { | 356 { |
356 pRenderer->ClearTarget(0); | 357 pRenderer->ClearTarget(0); |
906 { | 907 { |
907 v4 = _strcmpi(pVideoPlayer->pMightVideoHeaders[v3].pVideoName, pFilename); | 908 v4 = _strcmpi(pVideoPlayer->pMightVideoHeaders[v3].pVideoName, pFilename); |
908 if ( !v4 ) | 909 if ( !v4 ) |
909 { | 910 { |
910 SetFilePointer(pVideoPlayer->hMightVid, pVideoPlayer->pMightVideoHeaders[v3].uFileOffset, 0, 0); | 911 SetFilePointer(pVideoPlayer->hMightVid, pVideoPlayer->pMightVideoHeaders[v3].uFileOffset, 0, 0); |
911 return SmackOpen(pVideoPlayer->hMightVid, 0x7140, -1); | 912 return SmackOpen(pVideoPlayer->hMightVid, 0x7140, -1);//problem training house video in WinXP |
912 } | 913 } |
913 } | 914 } |
914 } | 915 } |
915 v5 = 0; | 916 v5 = 0; |
916 if ( (signed int)pVideoPlayer->uNumMagicVideoHeaders > 0 ) | 917 if ( (signed int)pVideoPlayer->uNumMagicVideoHeaders > 0 ) |
926 } | 927 } |
927 return 0; | 928 return 0; |
928 } | 929 } |
929 | 930 |
930 //----- (004BF28F) -------------------------------------------------------- | 931 //----- (004BF28F) -------------------------------------------------------- |
931 void VideoPlayer::_4BF28F(const char *pMovieName, unsigned int a3_1) | 932 void VideoPlayer::OpenHouseMovie(const char *pMovieName, unsigned int a3_1) |
932 { | 933 { |
933 VideoPlayer *v3; // esi@1 | 934 VideoPlayer *v3; // esi@1 |
934 std::string *v4; // ecx@3 | 935 std::string *v4; // ecx@3 |
935 _SMACK *v5; // eax@4 | 936 _SMACK *v5; // eax@4 |
936 _SMACK *v6; // eax@7 | 937 _SMACK *v6; // eax@7 |
956 v3->bLoopPlaying = a3_1; | 957 v3->bLoopPlaying = a3_1; |
957 if ( LOBYTE(v3->field_104) == 1 ) | 958 if ( LOBYTE(v3->field_104) == 1 ) |
958 { | 959 { |
959 v15 = "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Video.cpp:925"; | 960 v15 = "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Video.cpp:925"; |
960 v12 = "Unsupported Bink playback!"; | 961 v12 = "Unsupported Bink playback!"; |
961 LABEL_6: | 962 MessageBoxA(nullptr, v12, v15, 0); |
962 MessageBoxA(nullptr, v12, v15, 0); | |
963 return; | 963 return; |
964 } | 964 } |
965 sprintf(Str2, "%s.smk", pMovieName); | 965 sprintfex(Str2, "%s.smk", pMovieName); |
966 v5 = OpenSmack(Str2); | 966 v5 = OpenSmack(Str2); |
967 v3->pSmackerMovie = v5; | 967 v3->pSmackerMovie = v5; |
968 if ( !v5 ) | 968 if ( !v5 ) |
969 { | 969 { |
970 v3->Unload(); | 970 v3->Unload(); |
971 sprintf(pTmpBuf, "Can't load %s", &Str2); | 971 sprintf(pTmpBuf, "Can't load %s", &Str2); |
972 v15 = "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Video.cpp:937"; | 972 v15 = "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Video.cpp:937"; |
973 v12 = pTmpBuf; | 973 MessageBoxA(nullptr, pTmpBuf, v15, 0); |
974 goto LABEL_6; | 974 return; |
975 } | 975 } |
976 v16 = (int)pMovieName; | 976 v16 = (int)pMovieName; |
977 v3->uMovieFormat = 1; | 977 v3->uMovieFormat = 1; |
978 strcpy(v3->pCurrentMovieName, (const char *)v16); | 978 strcpy(v3->pCurrentMovieName, (const char *)v16); |
979 v6 = v3->pSmackerMovie; | 979 v6 = v3->pSmackerMovie; |
1000 { | 1000 { |
1001 return pSmackerMovie || pBinkMovie; | 1001 return pSmackerMovie || pBinkMovie; |
1002 } | 1002 } |
1003 | 1003 |
1004 //----- (004BF411) -------------------------------------------------------- | 1004 //----- (004BF411) -------------------------------------------------------- |
1005 void VideoPlayer::OpenMovie(const char *pFilename, unsigned int bLoop, int a4) | 1005 void VideoPlayer::OpenGlobalMovie(const char *pFilename, unsigned int bLoop, int a4) |
1006 { | 1006 { |
1007 VideoPlayer *pVideoPlayer; // esi@1 | 1007 VideoPlayer *pVideoPlayer; // esi@1 |
1008 _BINK *pVideoOpen; // eax@2 | 1008 _BINK *pVideoOpen; // eax@2 |
1009 _SMACK *v6; // eax@3 | 1009 _SMACK *v6; // eax@3 |
1010 _BINK *pBinkMovie; // eax@5 | 1010 _BINK *pBinkMovie; // eax@5 |
1033 pVideoPlayer->pBinkBuffer = CreateBinkBuffer(pVideoPlayer->hWindow, pBinkMovie->uWidth, pBinkMovie->uHeight, 0); | 1033 pVideoPlayer->pBinkBuffer = CreateBinkBuffer(pVideoPlayer->hWindow, pBinkMovie->uWidth, pBinkMovie->uHeight, 0); |
1034 } | 1034 } |
1035 else | 1035 else |
1036 { | 1036 { |
1037 Unload(); | 1037 Unload(); |
1038 sprintf(pVideoName, "%s.smk", pFilename); | 1038 sprintfex(pVideoName, "%s.smk", pFilename); |
1039 v6 = OpenSmack(pVideoName); | 1039 v6 = OpenSmack(pVideoName); |
1040 pVideoPlayer->pSmackerMovie = v6; | 1040 pVideoPlayer->pSmackerMovie = v6; |
1041 if ( !v6 ) | 1041 if ( !v6 ) |
1042 { | 1042 { |
1043 Unload(); | 1043 Unload(); |
1138 bGameoverLoop = 0; | 1138 bGameoverLoop = 0; |
1139 } | 1139 } |
1140 } | 1140 } |
1141 | 1141 |
1142 //----- (004BF73A) -------------------------------------------------------- | 1142 //----- (004BF73A) -------------------------------------------------------- |
1143 void VideoPlayer::_4BF73A() | 1143 void VideoPlayer::SelectMovieType() |
1144 { | 1144 { |
1145 VideoPlayer *v1; // esi@1 | 1145 VideoPlayer *v1; // esi@1 |
1146 int v2; // edi@1 | 1146 int v2; // edi@1 |
1147 unsigned __int8 v3; // bl@1 | 1147 unsigned __int8 v3; // bl@1 |
1148 int v4; // edi@1 | 1148 int v4; // edi@1 |
1155 Unload(); | 1155 Unload(); |
1156 v4 = v2 - 1; | 1156 v4 = v2 - 1; |
1157 if ( v4 ) | 1157 if ( v4 ) |
1158 { | 1158 { |
1159 if ( v4 == 1 ) | 1159 if ( v4 == 1 ) |
1160 OpenMovie(Source, v3, 1); | 1160 OpenGlobalMovie(Source, v3, 1); |
1161 } | 1161 } |
1162 else | 1162 else |
1163 { | 1163 { |
1164 _4BF28F(Source, v3); | 1164 OpenHouseMovie(Source, v3); |
1165 } | 1165 } |
1166 } | 1166 } |
1167 | 1167 |
1168 //----- (004BF8F6) -------------------------------------------------------- | 1168 //----- (004BF8F6) -------------------------------------------------------- |
1169 void VideoPlayer::PlayDeathMovie() | 1169 void VideoPlayer::PlayDeathMovie() |