changeset 2222:66bd74aa9f5e

smk video draw
author Ritor1
date Tue, 18 Feb 2014 19:43:54 +0600
parents c69013c186c7
children 17bc3a1eb037
files VideoPlayer.cpp
diffstat 1 files changed, 9 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/VideoPlayer.cpp	Tue Feb 18 16:18:20 2014 +0600
+++ b/VideoPlayer.cpp	Tue Feb 18 19:43:54 2014 +0600
@@ -869,9 +869,9 @@
 
 void VideoPlayer::UpdatePalette()
 {
-  unsigned __int16 *v3; // ebx@1
-  unsigned int v4; // edi@1
-  unsigned int v5; // eax@1
+  //unsigned __int16 *v3; // ebx@1
+  //unsigned int v4; // edi@1
+  //unsigned int v5; // eax@1
 
   Log::Warning(L"smacker");
 
@@ -879,8 +879,8 @@
 
   if (pMovie->Stopped())//видео завершено/перезагрузка
   {
-    int width = game_viewport_width;//pMovie->GetWidth();
-    int height = game_viewport_height;//pMovie->GetHeight();
+    int width = game_viewport_width;
+    int height = game_viewport_height;
     delete pMovie;
 
     SetFilePointer(hVidFile, uOffset, nullptr, FILE_BEGIN);
@@ -891,26 +891,17 @@
   {
 
     char *image = pPlayer->DoFrame();
+    int image_array[460 * 344];//game_viewport_width * game_viewport_height
 
     if (image)
     {
-  int num_r_bits = 5;
-  int num_g_bits = 6;
-  int num_b_bits = 5;
-
-  int r_mask = 0xF800;
-  int g_mask = 0x7E0;
-  int b_mask = 0x1F;
-      //memcpy(pRenderer->pTargetSurface, image, 480 * 480 * 4);//запись кадра на экран
+      memcpy(image_array, image, sizeof (image_array));
       for (unsigned int y = 8; y < 8 + game_viewport_height; ++y)
       {
         for (unsigned int x = 8; x < 8 + game_viewport_width; ++x)
         {
-          pRenderer->WritePixel16(x, y, image[((x - 8) + ((y - 8)*game_viewport_width))*4]);//4 - это шаг
-          //auto p = (unsigned __int32 *)pRenderer->pTargetSurface + x + y * pRenderer->uTargetSurfacePitch;
-          //*p = ((0xFF0000 & image[((x - 8) + ((y - 8)*game_viewport_width))*4]) >> (8 + 8))
-			// + ((0xFF00 & image[(((x - 8) + ((y - 8)*game_viewport_width))*4]) >> 8)
-			// + (0xFF & image[((x - 8) + ((y - 8)*game_viewport_width))*4]);
+          auto p = (unsigned __int32 *)pRenderer->pTargetSurface + x + y * pRenderer->uTargetSurfacePitch;
+          *p = image_array[((x - 8) + ((y - 8)*game_viewport_width))];
         }
       }
       delete[] image;