changeset 820:522591080ac5

.
author Nomad
date Tue, 26 Mar 2013 14:55:43 +0200
parents 9359c114f98c
children 5e3f4bf3b8e6 c232f160e6f3
files mm7_2.cpp
diffstat 1 files changed, 8 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/mm7_2.cpp	Tue Mar 26 14:14:39 2013 +0200
+++ b/mm7_2.cpp	Tue Mar 26 14:55:43 2013 +0200
@@ -6312,28 +6312,25 @@
 
     if ( pRenderer->LockSurface_DDraw4(pRenderer->pBackBuffer4, &Dst, DDLOCK_WAIT) )
     {
-      for (uint i = game_viewport_y; i < game_viewport_y+16; ++i)
-        memset32((char *)Dst.lpSurface + i * Dst.lPitch, 0xF800F800, Dst.lPitch / 4);
-      for (uint i = game_viewport_y+32; i < game_viewport_y+32+16; ++i)
-        memset32((char *)Dst.lpSurface + i * Dst.lPitch, 0x07E007E0, Dst.lPitch / 4);
-      for (uint i = game_viewport_y+64; i < game_viewport_y+64+16; ++i)
-        memset32((char *)Dst.lpSurface + i * Dst.lPitch, 0x001F001F, Dst.lPitch / 4);
-
       auto src = (unsigned __int16 *)Dst.lpSurface;
+      auto src_width = (Dst.lPitch / sizeof(short)),
+           src_height = Dst.dwHeight;
       auto dst = pPixels;
       for (uint y = 0; y < height; ++y)
       {
-        uint src_y = (game_viewport_y + y * v25) * (Dst.lPitch / sizeof(short));
-        assert((y + game_viewport_y) * v25 < Dst.dwHeight);
+        //uint src_y = (game_viewport_y + y * v25) * (Dst.lPitch / sizeof(short));
+        uint src_y = game_viewport_y + y * v25;
+        assert(game_viewport_y + y * v25 < src_height);
         assert(y < height);
 
         for (uint x = 0; x < width; ++x)
         {
+          //uint src_x = game_viewport_x + x * v23;
           uint src_x = game_viewport_x + x * v23;
-          assert(src_x < Dst.dwWidth);
+          assert(src_x < src_width);
           assert(x < width);
 
-          *dst++ = src[src_y + src_x];
+          dst[y * width + x] = (((63*y)/117) << 5) | 31*x/155;//31*y/117;//src[src_y * src_width + src_x];
         }
       }
       ErrD3D(pRenderer->pBackBuffer4->Unlock(0));