# HG changeset patch # User Nomad # Date 1364302543 -7200 # Node ID 522591080ac5b88c7f09d7348b25d0ed912a71e0 # Parent 9359c114f98cb4a0e4c5c7baee6433a64f87f132 . diff -r 9359c114f98c -r 522591080ac5 mm7_2.cpp --- 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));