comparison SaveLoad.cpp @ 2132:49de109bbab5

SavePCXScreenshot() continue
author Ritor1
date Sun, 29 Dec 2013 01:26:15 +0600
parents 651b24553ae9
children e378232bfd36
comparison
equal deleted inserted replaced
2131:651b24553ae9 2132:49de109bbab5
693 unsigned int screen_y; // [sp+90h] [bp-14h]@17 693 unsigned int screen_y; // [sp+90h] [bp-14h]@17
694 int v28; // [sp+98h] [bp-Ch]@16 694 int v28; // [sp+98h] [bp-Ch]@16
695 int v29; // [sp+9Ch] [bp-8h]@15 695 int v29; // [sp+9Ch] [bp-8h]@15
696 696
697 interval_x = game_viewport_width / (double)width; 697 interval_x = game_viewport_width / (double)width;
698 interval_y = game_viewport_height / (double)height;
698 699
699 pPixels = (unsigned __int16 *)malloc(2 * height * width); 700 pPixels = (unsigned __int16 *)malloc(2 * height * width);
700 memset(pPixels, 0 , 2 * height * width); 701 memset(pPixels, 0 , 2 * height * width);
701 702
702 v3 = pPixels; 703 v3 = pPixels;
722 { 723 {
723 //*v3 = pRenderer->ReadPixel16((int)(x* interval_x + 8.0), (int)(y * interval_y + 8.0));//screen_data[screen_y + (int)(x* interval_x + 8.0)]; 724 //*v3 = pRenderer->ReadPixel16((int)(x* interval_x + 8.0), (int)(y * interval_y + 8.0));//screen_data[screen_y + (int)(x* interval_x + 8.0)];
724 725
725 if (Dst.ddpfPixelFormat.dwRGBBitCount == 32) 726 if (Dst.ddpfPixelFormat.dwRGBBitCount == 32)
726 { 727 {
727 auto p = (unsigned __int32 *)Dst.lpSurface + (int)(x* interval_x + 8.0) + y * Dst.lPitch; 728 auto p = (unsigned __int32 *)Dst.lpSurface + (int)(x * interval_x + 8.0) + y /*(int)(y * interval_y + 8.0)*/ * Dst.lPitch;
728 *v3 = Color16((*p >> 16) & 255, (*p >> 8) & 255, *p & 255); 729 *v3 = Color16((*p >> 16) & 255, (*p >> 8) & 255, *p & 255);
729 } 730 }
730 else if (Dst.ddpfPixelFormat.dwRGBBitCount == 16) 731 else if (Dst.ddpfPixelFormat.dwRGBBitCount == 16)
731 { 732 {
732 auto p = (unsigned __int16 *)Dst.lpSurface + x + y * Dst.lPitch; 733 auto p = (unsigned __int16 *)Dst.lpSurface + (int)(x * interval_x + 8.0) + y * Dst.lPitch;
733 *v3 = *p; 734 *v3 = *p;
734 } 735 }
735 else __debugbreak(); 736 else __debugbreak();
736 ++v3; 737 ++v3;
737 } 738 }