Changeset 6935 for trunk/src/ddraw/OS2SURFACE.CPP
- Timestamp:
- Oct 3, 2001, 3:49:41 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/ddraw/OS2SURFACE.CPP
r6901 r6935 1 /* $Id: OS2SURFACE.CPP,v 1.3 3 2001-09-30 22:23:44sandervl Exp $ */1 /* $Id: OS2SURFACE.CPP,v 1.34 2001-10-03 13:49:40 sandervl Exp $ */ 2 2 3 3 /* … … 6 6 * Copyright 1999 Markus Montkowski 7 7 * Copyright 2000 Michal Necasek 8 * Copyright 1998-2001 Sander van Leeuwen 8 9 * 9 10 * Project Odin Software License can be found in LICENSE.TXT … … 2162 2163 LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx) 2163 2164 { 2165 OS2IDirectDrawSurface *dest = (OS2IDirectDrawSurface *)This; 2166 OS2IDirectDrawSurface *src = (OS2IDirectDrawSurface *)lpDDSrcSurface; 2167 2168 DDSURFACEDESC2 DestSurfaceDesc, SrcSurfaceDesc; 2169 DDRectangle *pIRectDest,*pIRectSrc,*pIRectTest; 2170 RECT DestRect, SrcRect; 2171 BOOL Found; 2172 int i; 2173 HRESULT ret = DD_OK; 2174 2175 #ifdef DEBUG 2176 dprintf(("DDRAW: SurfBlt4 To Surf %08X, from Surf %08X\n",dest,src)); 2177 if ( (NULL!=lpDestRect)&& (NULL!=lpSrcRect)) 2178 dprintf(("DDRAW: SurfBlt4 to (%d,%d)(%d,%d) at %08X from (%d,%d)(%d,%d) at %08X\n", lpDestRect->left, lpDestRect->top, 2179 lpDestRect->right, lpDestRect->bottom, dest, lpSrcRect->left, lpSrcRect->top, 2180 lpSrcRect->right, lpSrcRect->bottom, src)); 2181 2182 _dump_DDBLT(dwFlags); 2183 #endif 2184 2185 if (NULL!=lpDestRect) 2186 { 2187 // HACK: RA does pass in negative values we might be better return an error, 2188 //for now we clip 2189 #define RA_HACK 1 2190 2191 #ifdef RA_HACK 2192 int top,left,bottom,right; 2193 2194 top = lpDestRect->top; 2195 left = lpDestRect->left; 2196 bottom = lpDestRect->bottom; 2197 right = lpDestRect->right; 2198 2199 if(top<0) 2200 { 2201 bottom += top; 2202 top = 0; 2203 } 2204 2205 if(top > dest->height) 2206 return DDERR_INVALIDPARAMS; 2207 2208 if(bottom<0) 2209 return DDERR_INVALIDPARAMS; 2210 2211 if(bottom>dest->height) 2212 bottom=dest->height; 2213 2214 if(left<0) 2215 { 2216 right += left; 2217 left = 0; 2218 } 2219 2220 if(left>dest->width) 2221 return DDERR_INVALIDPARAMS; 2222 2223 if(right<0) 2224 return DDERR_INVALIDPARAMS; 2225 2226 if(right>dest->width) 2227 right = dest->width; 2228 #endif // RA_HACK 2229 2230 pIRectDest = new DDRectangle( left, top, right, bottom); 2231 #ifdef RA_HACK 2232 DestRect.top = top; 2233 DestRect.left = left; 2234 DestRect.bottom = bottom; 2235 DestRect.right = right; 2236 #else 2237 memcpy(&DestRect,lpDestRect,sizeof(RECT) ); 2238 #endif //RA_HACK 2239 } 2240 else 2241 { 2242 pIRectDest = new DDRectangle( 0, 0, dest->width, dest->height); 2243 DestRect.top = 0; 2244 DestRect.left = 0; 2245 DestRect.bottom = dest->height; 2246 DestRect.right = dest->width; 2247 } 2248 2249 if(dest->fLocked) 2250 { 2251 if (NULL==lpDestRect) 2252 { 2253 // If anything is locked we can't blit to the complete surface as 2254 // a part is locked 2255 Found = TRUE; 2256 } 2257 else 2258 { 2259 // If the dest Rectangle intersects with any of the locked rectangles 2260 // we can't blit to it 2261 2262 Found = FALSE; 2263 i=0; 2264 while( (i<DPA_GetPtrCount(dest->DPA_LockedRects)) && !Found) 2265 { 2266 pIRectTest = (DDRectangle*) DPA_FastGetPtr(dest->DPA_LockedRects,i); 2267 Found = pIRectDest->intersects(*pIRectTest); 2268 i++; 2269 } 2270 2271 } 2272 if (Found) 2273 { 2274 delete pIRectDest; 2275 dprintf(("DDRAW: Blt: Dest Surface partially locked\n")); 2276 return(DDERR_SURFACEBUSY); 2277 } 2278 } 2279 delete pIRectDest; 2280 2281 if (NULL!=lpSrcRect) 2282 { 2283 #ifdef RA_HACK 2284 // Same as for dest rectangle now for src 2285 2286 int top,left,bottom,right; 2287 2288 top = lpSrcRect->top; 2289 left = lpSrcRect->left; 2290 bottom = lpSrcRect->bottom; 2291 right = lpSrcRect->right; 2292 2293 if(top<0) 2294 { 2295 bottom += top; 2296 top = 0; 2297 } 2298 2299 if(top > src->height) 2300 return DDERR_INVALIDPARAMS; 2301 2302 if(bottom<0) 2303 return DDERR_INVALIDPARAMS; 2304 2305 if(bottom>src->height) 2306 bottom=src->height; 2307 2308 if(left<0) 2309 { 2310 right += left; 2311 left = 0; 2312 } 2313 2314 if(left>src->width) 2315 return DDERR_INVALIDPARAMS; 2316 2317 if(right<0) 2318 return DDERR_INVALIDPARAMS; 2319 2320 if(right>src->width) 2321 right = src->width; 2322 #endif // RA_HACK 2323 2324 pIRectSrc = new DDRectangle( left, top, right, bottom ); 2325 #ifdef RA_HACK 2326 SrcRect.top = top; 2327 SrcRect.left = left; 2328 SrcRect.bottom = bottom; 2329 SrcRect.right = right; 2330 #else 2331 memcpy(&SrcRect,lpSrcRect,sizeof(RECT) ); 2332 #endif 2333 } 2334 else 2335 { 2336 pIRectSrc = new DDRectangle( 0, 0, src->width, src->height); 2337 SrcRect.top = 0; 2338 SrcRect.left = 0; 2339 SrcRect.bottom = src->height; 2340 SrcRect.right = src->width; 2341 } 2342 2343 if(src->fLocked) 2344 { 2345 if (NULL==lpSrcRect) 2346 { 2347 // If anything is locked we can't blit from the complete surface as 2348 // a part is locked 2349 Found = TRUE; 2350 } 2351 else 2352 { 2353 // If the src Rectangle intersects with any of the locked rectangles of the 2354 // source surface we can't blit from it 2355 2356 Found = FALSE; 2357 i=0; 2358 2359 while((i<DPA_GetPtrCount(src->DPA_LockedRects) ) && !Found) 2360 { 2361 pIRectTest = (DDRectangle*) DPA_FastGetPtr(src->DPA_LockedRects,i); 2362 Found = pIRectDest->intersects(*pIRectTest); 2363 i++; 2364 } 2365 2366 } 2367 2368 if (Found) 2369 { 2370 delete pIRectSrc; 2371 dprintf(("DDRAW: Blt: Src Surface partly locked\n")); 2372 2373 return(DDERR_SURFACEBUSY); 2374 } 2375 } 2376 delete pIRectSrc; 2377 2378 //TODO: do we need to check the source for clipping information in case 2379 // the app wants to copy from the frame buffer? 2380 if(dest->lpClipper) 2381 { 2382 DWORD rgnsize; 2383 if(ClipGetClipList((IDirectDrawClipper*)dest->lpClipper, NULL, NULL, &rgnsize) == DD_OK) 2384 { 2385 LPRGNDATA lpRgnData = (LPRGNDATA)alloca(rgnsize); 2386 if(lpRgnData == NULL) { 2387 DebugInt3(); 2388 goto doblit; 2389 } 2390 if(ClipGetClipList((IDirectDrawClipper*)dest->lpClipper, NULL, lpRgnData, &rgnsize) == DD_OK) 2391 { 2392 RECT newdest, newsrc; 2393 LPRECT lpClipRect = (LPRECT)&lpRgnData->Buffer; 2394 2395 for(i=0;i<lpRgnData->rdh.nCount;i++) 2396 { 2397 if(IntersectRect(&newdest, &DestRect, &lpClipRect[i]) == TRUE) 2398 { 2399 //TODO: This is not correct for stretching blits 2400 newsrc.left = SrcRect.left + (newdest.left - DestRect.left); 2401 newsrc.top = SrcRect.top + (newdest.top - DestRect.top); 2402 newsrc.right = newsrc.left + RECT_WIDTH(&newdest); 2403 newsrc.bottom = newsrc.top + RECT_HEIGHT(&newdest); 2404 2405 ret = SurfDoBlt(This, &newdest, lpDDSrcSurface, &newsrc, dwFlags, lpDDBltFx); 2406 if(ret != DD_OK) { 2407 break; 2408 } 2409 } 2410 } 2411 return ret; 2412 } 2413 } 2414 } 2415 doblit: 2416 return SurfDoBlt(This, &DestRect, lpDDSrcSurface, &SrcRect, dwFlags, lpDDBltFx); 2417 } 2418 //****************************************************************************** 2419 //****************************************************************************** 2420 HRESULT WIN32API SurfDoBlt(THIS This, LPRECT lpDestRect, LPDIRECTDRAWSURFACE4 lpDDSrcSurface, 2421 LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx) 2422 { 2164 2423 // We have determine between 3 different blit senarios. 2165 2424 // 1. Blitting between Divebuffers (Front/Backbuffer and primary surface) … … 2178 2437 2179 2438 int x, i, BlitWidth, BlitHeight; 2180 PALETTEENTRY SysPal[257]; 2181 PLOGPALETTE pLogPal = (PLOGPALETTE) SysPal; 2182 char *pBltPos, *pSrcPos; 2439 char *pBltPos, *pSrcPos; 2183 2440 DDSURFACEDESC2 DestSurfaceDesc, SrcSurfaceDesc; 2184 DDRectangle *pIRectDest,*pIRectSrc,*pIRectTest;2185 RECTL DestRect, SrcRect;2186 2441 BOOL Found; 2187 2442 DWORD dwSrcColor, dwDestColor; 2188 2443 2189 #ifdef DEBUG 2190 dprintf(("DDRAW: SurfBlt4 To Surf %08X, from Surf %08X\n",dest,src)); 2191 if ( (NULL!=lpDestRect)&& (NULL!=lpSrcRect)) 2192 dprintf(("DDRAW: SurfBlt4 to (%d,%d)(%d,%d) at %08X from (%d,%d)(%d,%d) at %08X\n", lpDestRect->left, lpDestRect->top, 2444 dprintf(("DDRAW: SurfDoBlt To Surf %08X, from Surf %08X\n",dest,src)); 2445 if ( (NULL!=lpDestRect)&& (NULL!=lpSrcRect)) 2446 dprintf(("DDRAW: SurfDoBlt to (%d,%d)(%d,%d) at %08X from (%d,%d)(%d,%d) at %08X\n", lpDestRect->left, lpDestRect->top, 2193 2447 lpDestRect->right, lpDestRect->bottom, dest, lpSrcRect->left, lpSrcRect->top, 2194 2448 lpSrcRect->right, lpSrcRect->bottom, src)); 2195 2196 _dump_DDBLT(dwFlags);2197 #endif2198 2199 2200 if (NULL!=lpDestRect)2201 {2202 // HACK: RA does pss in negative values we might be better etrun an error,2203 //for now we clip2204 #define RA_HACK 12205 2206 #ifdef RA_HACK2207 int top,left,bottom,right;2208 2209 top = lpDestRect->top;2210 left = lpDestRect->left;2211 bottom = lpDestRect->bottom;2212 right = lpDestRect->right;2213 2214 if(top<0)2215 {2216 bottom += top;2217 top = 0;2218 }2219 2220 if(top > dest->height)2221 return DDERR_INVALIDPARAMS;2222 2223 if(bottom<0)2224 return DDERR_INVALIDPARAMS;2225 2226 if(bottom>dest->height)2227 bottom=dest->height;2228 2229 if(left<0)2230 {2231 right += left;2232 left = 0;2233 }2234 2235 if(left>dest->width)2236 return DDERR_INVALIDPARAMS;2237 2238 if(right<0)2239 return DDERR_INVALIDPARAMS;2240 2241 if(right>dest->width)2242 right = dest->width;2243 #endif // RA_HACK2244 2245 pIRectDest = new DDRectangle( top,2246 left,2247 bottom,2248 right);2249 #ifdef RA_HACK2250 DestRect.top = top;2251 DestRect.left = left;2252 DestRect.bottom = bottom;2253 DestRect.right = right;2254 #else2255 memcpy(&DestRect,lpDestRect,sizeof(RECTL) );2256 #endif //RA_HACK2257 }2258 else2259 {2260 pIRectDest = new DDRectangle( 0, 0, dest->height, dest->width);2261 DestRect.top = 0;2262 DestRect.left = 0;2263 DestRect.bottom = dest->height;2264 DestRect.right = dest->width;2265 }2266 2267 if(dest->fLocked)2268 {2269 if (NULL==lpDestRect)2270 {2271 // If anything is locked we can't blit to the complete surface as2272 // a part is locked2273 Found = TRUE;2274 }2275 else2276 {2277 // If the dest Rectangle intersects with any of the locked rectangles2278 // we can't blit to it2279 2280 Found = FALSE;2281 i=0;2282 while( (i<DPA_GetPtrCount(dest->DPA_LockedRects)) && !Found)2283 {2284 pIRectTest = (DDRectangle*) DPA_FastGetPtr(dest->DPA_LockedRects,i);2285 Found = pIRectDest->intersects(*pIRectTest);2286 i++;2287 }2288 2289 }2290 2291 if (Found)2292 {2293 delete pIRectDest;2294 dprintf(("DDRAW: Blt: Dest Surface partially locked\n"));2295 return(DDERR_SURFACEBUSY);2296 }2297 }2298 2449 2299 2450 DestSurfaceDesc.dwSize = sizeof(DDSURFACEDESC2); … … 2379 2530 } 2380 2531 2381 if (NULL!=lpSrcRect)2382 {2383 #ifdef RA_HACK2384 // Same as for dest rectangle now for src2385 2386 int top,left,bottom,right;2387 2388 top = lpSrcRect->top;2389 left = lpSrcRect->left;2390 bottom = lpSrcRect->bottom;2391 right = lpSrcRect->right;2392 2393 if(top<0)2394 {2395 bottom += top;2396 top = 0;2397 }2398 2399 if(top > src->height)2400 return DDERR_INVALIDPARAMS;2401 2402 if(bottom<0)2403 return DDERR_INVALIDPARAMS;2404 2405 if(bottom>src->height)2406 bottom=src->height;2407 2408 if(left<0)2409 {2410 right += left;2411 left = 0;2412 }2413 2414 if(left>src->width)2415 return DDERR_INVALIDPARAMS;2416 2417 if(right<0)2418 return DDERR_INVALIDPARAMS;2419 2420 if(right>src->width)2421 right = src->width;2422 #endif // RA_HACK2423 2424 pIRectSrc = new DDRectangle( top,2425 left,2426 bottom,2427 right);2428 #ifdef RA_HACK2429 SrcRect.top = top;2430 SrcRect.left = left;2431 SrcRect.bottom = bottom;2432 SrcRect.right = right;2433 #else2434 memcpy(&SrcRect,lpSrcRect,sizeof(RECTL) );2435 #endif2436 }2437 else2438 {2439 pIRectSrc = new DDRectangle( 0, 0, src->height, src->width);2440 SrcRect.top = 0;2441 SrcRect.left = 0;2442 SrcRect.bottom = src->height;2443 SrcRect.right = src->width;2444 }2445 2446 if(src->fLocked)2447 {2448 if (NULL==lpSrcRect)2449 {2450 // If anything is locked we can't blit from the complete surface as2451 // a part is locked2452 Found = TRUE;2453 }2454 else2455 {2456 // If the src Rectangle intersects with any of the locked rectangles of the2457 // source surface we can't blit from it2458 2459 Found = FALSE;2460 i=0;2461 2462 while((i<DPA_GetPtrCount(src->DPA_LockedRects) ) && !Found)2463 {2464 pIRectTest = (DDRectangle*) DPA_FastGetPtr(src->DPA_LockedRects,i);2465 Found = pIRectDest->intersects(*pIRectTest);2466 i++;2467 }2468 2469 }2470 2471 if (Found)2472 {2473 delete pIRectSrc;2474 dprintf(("DDRAW: Blt: Src Surface partly locked\n"));2475 2476 return(DDERR_SURFACEBUSY);2477 }2478 }2479 2480 2532 if( ( (NULL==lpDestRect) && (NULL!=lpSrcRect) ) || 2481 2533 ( (NULL==lpSrcRect) && (NULL!=lpDestRect) ) ) … … 2486 2538 } 2487 2539 2488 if( ( pIRectDest->width() != pIRectSrc->width() ) ||2489 ( pIRectDest->height() != pIRectSrc->height() )2540 if( ( RECT_WIDTH(lpDestRect) != RECT_WIDTH(lpSrcRect) ) || 2541 ( RECT_HEIGHT(lpDestRect) != RECT_HEIGHT(lpSrcRect) ) 2490 2542 ) 2491 2543 { … … 2505 2557 dprintf(("DDRAW: Src is Primary Surface\n")); 2506 2558 2507 if( *pIRectDest == *pIRectSrc)2559 if( RECT_EQUAL(lpDestRect, lpSrcRect)) 2508 2560 return DD_OK; // rects are the same => no blit needed 2509 2561 … … 2511 2563 2512 2564 MoveRects( dest->pDiveBuffer, 2513 (LPRECT)&DestRect,2514 (LPRECT)&SrcRect,2565 lpDestRect, 2566 lpSrcRect, 2515 2567 dest->dwBytesPPDive, 2516 2568 dest->dwPitchDB); … … 2519 2571 { 2520 2572 MoveRects( dest->pFrameBuffer, 2521 (LPRECT)&DestRect,2522 (LPRECT)&SrcRect,2573 lpDestRect, 2574 lpSrcRect, 2523 2575 dest->lpDraw->GetScreenBpp()>>3, 2524 2576 dest->dwPitchFB); … … 2554 2606 dest->BltSolid( dest->pDiveBuffer, 2555 2607 dest->pFrameBuffer, 2556 DestRect.top,2557 DestRect.left,2608 lpDestRect->top, 2609 lpDestRect->left, 2558 2610 dest->dwPitchDB, 2559 2611 dest->dwPitchFB, 2560 2612 src->pDiveBuffer, 2561 2613 src->pFrameBuffer, 2562 SrcRect.top,2563 SrcRect.left,2564 pIRectDest->width(),2565 pIRectDest->height(),2614 lpSrcRect->top, 2615 lpSrcRect->left, 2616 RECT_WIDTH(lpDestRect), 2617 RECT_HEIGHT(lpDestRect), 2566 2618 src->dwPitchDB, 2567 2619 src->dwPitchFB … … 2571 2623 else 2572 2624 { 2573 pBltPos = (char*) dest->pDiveBuffer + ( DestRect.top * dest->dwPitchDB) +2574 ( DestRect.left * dest->dwBytesPPDive);2575 2576 pSrcPos = (char*) src->pDiveBuffer + ( SrcRect.top * src->dwPitchDB) +2577 ( SrcRect.left * src->dwBytesPPDive);2578 2579 BlitHeight = pIRectDest->height();2580 BlitWidth = pIRectDest->width();2625 pBltPos = (char*) dest->pDiveBuffer + (lpDestRect->top * dest->dwPitchDB) + 2626 (lpDestRect->left * dest->dwBytesPPDive); 2627 2628 pSrcPos = (char*) src->pDiveBuffer + (lpSrcRect->top * src->dwPitchDB) + 2629 (lpSrcRect->left * src->dwBytesPPDive); 2630 2631 BlitHeight = RECT_HEIGHT(lpDestRect); 2632 BlitWidth = RECT_WIDTH(lpDestRect); 2581 2633 // Transparent Blit 2582 2634 if( (dwFlags &DDBLT_KEYSRC) || (dwFlags & DDBLT_KEYSRCOVERRIDE) ) … … 2609 2661 // DIVE => DIVE or Mem => Dive 2610 2662 // or a rectangle from streen to a buffer can be handelt in the same way 2611 pBltPos = (char*) dest->pDiveBuffer + ( DestRect.top * dest->dwPitchDB) +2612 ( DestRect.left * dest->dwBytesPPDive);2613 2614 pSrcPos = (char*) src->pDiveBuffer + ( SrcRect.top * src->dwPitchDB) +2615 ( SrcRect.left * src->dwBytesPPDive);2616 2617 BlitHeight = pIRectDest->height();2618 BlitWidth = pIRectDest->width();2663 pBltPos = (char*) dest->pDiveBuffer + (lpDestRect->top * dest->dwPitchDB) + 2664 (lpDestRect->left * dest->dwBytesPPDive); 2665 2666 pSrcPos = (char*) src->pDiveBuffer + (lpSrcRect->top * src->dwPitchDB) + 2667 (lpSrcRect->left * src->dwBytesPPDive); 2668 2669 BlitHeight = RECT_HEIGHT(lpDestRect); 2670 BlitWidth = RECT_WIDTH(lpDestRect); 2619 2671 2620 2672 // Check for transparent blit … … 2623 2675 dest->BltSolid( dest->pDiveBuffer, 2624 2676 dest->pFrameBuffer, 2625 DestRect.top,2626 DestRect.left,2677 lpDestRect->top, 2678 lpDestRect->left, 2627 2679 dest->dwPitchDB, 2628 2680 dest->dwPitchFB, 2629 2681 src->pDiveBuffer, 2630 2682 src->pFrameBuffer, 2631 SrcRect.top,2632 SrcRect.left,2633 pIRectDest->width(),2634 pIRectDest->height(),2683 lpSrcRect->top, 2684 lpSrcRect->left, 2685 RECT_WIDTH(lpDestRect), 2686 RECT_HEIGHT(lpDestRect), 2635 2687 src->dwPitchDB, 2636 2688 src->dwPitchFB … … 2663 2715 2664 2716 if( (src->pDiveBuffer == dest->pDiveBuffer) && 2665 ( pIRectDest->intersects(*pIRectSrc) ) )2717 (intersects(lpDestRect, lpSrcRect) ) ) 2666 2718 { 2667 2719 // Overlapping rects on the same surface ? … … 2670 2722 2671 2723 MoveRects( dest->pDiveBuffer, 2672 (LPRECT)&DestRect,2673 (LPRECT)&SrcRect,2724 lpDestRect, 2725 lpSrcRect, 2674 2726 dest->dwBytesPPDive, 2675 2727 dest->dwPitchDB); … … 2679 2731 { 2680 2732 MoveRects( dest->pFrameBuffer, 2681 (LPRECT)&DestRect,2682 (LPRECT)&SrcRect,2733 lpDestRect, 2734 lpSrcRect, 2683 2735 dest->lpDraw->GetScreenBpp()>>3, 2684 2736 dest->dwPitchFB); … … 2692 2744 dest->BltSolid( dest->pDiveBuffer, 2693 2745 dest->pFrameBuffer, 2694 DestRect.top,2695 DestRect.left,2746 lpDestRect->top, 2747 lpDestRect->left, 2696 2748 dest->dwPitchDB, 2697 2749 dest->dwPitchFB, 2698 2750 src->pDiveBuffer, 2699 2751 src->pFrameBuffer, 2700 SrcRect.top,2701 SrcRect.left,2702 pIRectDest->width(),2703 pIRectDest->height(),2752 lpSrcRect->top, 2753 lpSrcRect->left, 2754 RECT_WIDTH(lpDestRect), 2755 RECT_HEIGHT(lpDestRect), 2704 2756 src->dwPitchDB, 2705 2757 src->dwPitchFB … … 2708 2760 else 2709 2761 { 2710 pBltPos = (char*) dest->pDiveBuffer + ( DestRect.top * dest->dwPitchDB) +2711 ( DestRect.left * dest->dwBytesPPDive);2712 2713 pSrcPos = (char*) src->pDiveBuffer + ( SrcRect.top * src->dwPitchDB) +2714 ( SrcRect.left * src->dwBytesPPDive);2715 2716 BlitHeight = pIRectDest->height();2717 BlitWidth = pIRectDest->width();2762 pBltPos = (char*) dest->pDiveBuffer + (lpDestRect->top * dest->dwPitchDB) + 2763 (lpDestRect->left * dest->dwBytesPPDive); 2764 2765 pSrcPos = (char*) src->pDiveBuffer + (lpSrcRect->top * src->dwPitchDB) + 2766 (lpSrcRect->left * src->dwBytesPPDive); 2767 2768 BlitHeight = RECT_HEIGHT(lpDestRect); 2769 BlitWidth = RECT_WIDTH(lpDestRect); 2718 2770 DWORD dwPitch = dest->dwPitchDB; 2719 2771 … … 2751 2803 dwPitch = -dwPitch; 2752 2804 pBltPos = (char*) dest->pDiveBuffer + 2753 (( DestRect.top +BlitHeight)* dest->dwPitchDB) +2754 ( DestRect.left * dest->dwBytesPPDive);2805 ((lpDestRect->top +BlitHeight)* dest->dwPitchDB) + 2806 (lpDestRect->left * dest->dwBytesPPDive); 2755 2807 2756 2808 dwFx &= ~DDBLTFX_MIRRORUPDOWN; // remove handled flag … … 4654 4706 } 4655 4707 4656 4657 4708 return rc; 4658 4709 } … … 5000 5051 Found = (pIRectEnum != NULL); 5001 5052 #else 5002 pIRectUnlock = new DDRectangle( 0, 0, me-> height, me->width);5053 pIRectUnlock = new DDRectangle( 0, 0, me->width, me->height); 5003 5054 5004 5055 while(i<DPA_GetPtrCount(me->DPA_LockedRects) && !Found) … … 5115 5166 { 5116 5167 dprintf(("DDRAW: Unlock rectangle\n")); 5117 pIRectUnlock = new DDRectangle( lpSurfaceRect->top, 5118 lpSurfaceRect->left, 5119 lpSurfaceRect->bottom, 5120 lpSurfaceRect->right); 5168 pIRectUnlock = new DDRectangle( lpSurfaceRect->left, lpSurfaceRect->top, 5169 lpSurfaceRect->right, lpSurfaceRect->bottom); 5121 5170 } 5122 5171 else 5123 5172 { 5124 5173 dprintf(("DDRAW: Unlock complete surface\n")); 5125 pIRectUnlock = new DDRectangle( 0, 0, me-> height, me->width);5174 pIRectUnlock = new DDRectangle( 0, 0, me->width, me->height); 5126 5175 } 5127 5176 … … 5191 5240 dprintf(("DDRAW: Unlock OK\n\n")); 5192 5241 rc = DD_OK; 5242 5193 5243 } 5194 5244
Note:
See TracChangeset
for help on using the changeset viewer.