Mercurial > mm7
comparison VideoPlayer.cpp @ 2222:66bd74aa9f5e
smk video draw
author | Ritor1 |
---|---|
date | Tue, 18 Feb 2014 19:43:54 +0600 |
parents | c69013c186c7 |
children | 17bc3a1eb037 |
comparison
equal
deleted
inserted
replaced
2221:c69013c186c7 | 2222:66bd74aa9f5e |
---|---|
867 } | 867 } |
868 //auto pixels = new unsigned short[640 * 480]; | 868 //auto pixels = new unsigned short[640 * 480]; |
869 | 869 |
870 void VideoPlayer::UpdatePalette() | 870 void VideoPlayer::UpdatePalette() |
871 { | 871 { |
872 unsigned __int16 *v3; // ebx@1 | 872 //unsigned __int16 *v3; // ebx@1 |
873 unsigned int v4; // edi@1 | 873 //unsigned int v4; // edi@1 |
874 unsigned int v5; // eax@1 | 874 //unsigned int v5; // eax@1 |
875 | 875 |
876 Log::Warning(L"smacker"); | 876 Log::Warning(L"smacker"); |
877 | 877 |
878 pRenderer->BeginScene(); | 878 pRenderer->BeginScene(); |
879 | 879 |
880 if (pMovie->Stopped())//видео завершено/перезагрузка | 880 if (pMovie->Stopped())//видео завершено/перезагрузка |
881 { | 881 { |
882 int width = game_viewport_width;//pMovie->GetWidth(); | 882 int width = game_viewport_width; |
883 int height = game_viewport_height;//pMovie->GetHeight(); | 883 int height = game_viewport_height; |
884 delete pMovie; | 884 delete pMovie; |
885 | 885 |
886 SetFilePointer(hVidFile, uOffset, nullptr, FILE_BEGIN); | 886 SetFilePointer(hVidFile, uOffset, nullptr, FILE_BEGIN); |
887 | 887 |
888 pMovie = pPlayer->LoadMovieFromLOD(hVidFile, &readFunction, &seekFunction, width, height); | 888 pMovie = pPlayer->LoadMovieFromLOD(hVidFile, &readFunction, &seekFunction, width, height); |
889 } | 889 } |
890 else | 890 else |
891 { | 891 { |
892 | 892 |
893 char *image = pPlayer->DoFrame(); | 893 char *image = pPlayer->DoFrame(); |
894 int image_array[460 * 344];//game_viewport_width * game_viewport_height | |
894 | 895 |
895 if (image) | 896 if (image) |
896 { | 897 { |
897 int num_r_bits = 5; | 898 memcpy(image_array, image, sizeof (image_array)); |
898 int num_g_bits = 6; | |
899 int num_b_bits = 5; | |
900 | |
901 int r_mask = 0xF800; | |
902 int g_mask = 0x7E0; | |
903 int b_mask = 0x1F; | |
904 //memcpy(pRenderer->pTargetSurface, image, 480 * 480 * 4);//запись кадра на экран | |
905 for (unsigned int y = 8; y < 8 + game_viewport_height; ++y) | 899 for (unsigned int y = 8; y < 8 + game_viewport_height; ++y) |
906 { | 900 { |
907 for (unsigned int x = 8; x < 8 + game_viewport_width; ++x) | 901 for (unsigned int x = 8; x < 8 + game_viewport_width; ++x) |
908 { | 902 { |
909 pRenderer->WritePixel16(x, y, image[((x - 8) + ((y - 8)*game_viewport_width))*4]);//4 - это шаг | 903 auto p = (unsigned __int32 *)pRenderer->pTargetSurface + x + y * pRenderer->uTargetSurfacePitch; |
910 //auto p = (unsigned __int32 *)pRenderer->pTargetSurface + x + y * pRenderer->uTargetSurfacePitch; | 904 *p = image_array[((x - 8) + ((y - 8)*game_viewport_width))]; |
911 //*p = ((0xFF0000 & image[((x - 8) + ((y - 8)*game_viewport_width))*4]) >> (8 + 8)) | |
912 // + ((0xFF00 & image[(((x - 8) + ((y - 8)*game_viewport_width))*4]) >> 8) | |
913 // + (0xFF & image[((x - 8) + ((y - 8)*game_viewport_width))*4]); | |
914 } | 905 } |
915 } | 906 } |
916 delete[] image; | 907 delete[] image; |
917 } | 908 } |
918 } | 909 } |