comparison mm7_2.cpp @ 820:522591080ac5

.
author Nomad
date Tue, 26 Mar 2013 14:55:43 +0200
parents 9359c114f98c
children 5e3f4bf3b8e6 c232f160e6f3
comparison
equal deleted inserted replaced
819:9359c114f98c 820:522591080ac5
6310 memset(&Dst, 0, 0x7Cu); 6310 memset(&Dst, 0, 0x7Cu);
6311 Dst.dwSize = sizeof(Dst); 6311 Dst.dwSize = sizeof(Dst);
6312 6312
6313 if ( pRenderer->LockSurface_DDraw4(pRenderer->pBackBuffer4, &Dst, DDLOCK_WAIT) ) 6313 if ( pRenderer->LockSurface_DDraw4(pRenderer->pBackBuffer4, &Dst, DDLOCK_WAIT) )
6314 { 6314 {
6315 for (uint i = game_viewport_y; i < game_viewport_y+16; ++i)
6316 memset32((char *)Dst.lpSurface + i * Dst.lPitch, 0xF800F800, Dst.lPitch / 4);
6317 for (uint i = game_viewport_y+32; i < game_viewport_y+32+16; ++i)
6318 memset32((char *)Dst.lpSurface + i * Dst.lPitch, 0x07E007E0, Dst.lPitch / 4);
6319 for (uint i = game_viewport_y+64; i < game_viewport_y+64+16; ++i)
6320 memset32((char *)Dst.lpSurface + i * Dst.lPitch, 0x001F001F, Dst.lPitch / 4);
6321
6322 auto src = (unsigned __int16 *)Dst.lpSurface; 6315 auto src = (unsigned __int16 *)Dst.lpSurface;
6316 auto src_width = (Dst.lPitch / sizeof(short)),
6317 src_height = Dst.dwHeight;
6323 auto dst = pPixels; 6318 auto dst = pPixels;
6324 for (uint y = 0; y < height; ++y) 6319 for (uint y = 0; y < height; ++y)
6325 { 6320 {
6326 uint src_y = (game_viewport_y + y * v25) * (Dst.lPitch / sizeof(short)); 6321 //uint src_y = (game_viewport_y + y * v25) * (Dst.lPitch / sizeof(short));
6327 assert((y + game_viewport_y) * v25 < Dst.dwHeight); 6322 uint src_y = game_viewport_y + y * v25;
6323 assert(game_viewport_y + y * v25 < src_height);
6328 assert(y < height); 6324 assert(y < height);
6329 6325
6330 for (uint x = 0; x < width; ++x) 6326 for (uint x = 0; x < width; ++x)
6331 { 6327 {
6328 //uint src_x = game_viewport_x + x * v23;
6332 uint src_x = game_viewport_x + x * v23; 6329 uint src_x = game_viewport_x + x * v23;
6333 assert(src_x < Dst.dwWidth); 6330 assert(src_x < src_width);
6334 assert(x < width); 6331 assert(x < width);
6335 6332
6336 *dst++ = src[src_y + src_x]; 6333 dst[y * width + x] = (((63*y)/117) << 5) | 31*x/155;//31*y/117;//src[src_y * src_width + src_x];
6337 } 6334 }
6338 } 6335 }
6339 ErrD3D(pRenderer->pBackBuffer4->Unlock(0)); 6336 ErrD3D(pRenderer->pBackBuffer4->Unlock(0));
6340 } 6337 }
6341 else 6338 else