- Timestamp:
- Mar 18, 2000, 10:17:58 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/ddraw/OS2SURFACE.CPP
r2987 r3161 1 /* $Id: OS2SURFACE.CPP,v 1.2 4 2000-03-03 19:21:24 hughExp $ */1 /* $Id: OS2SURFACE.CPP,v 1.25 2000-03-18 21:17:58 mike Exp $ */ 2 2 3 3 /* … … 1665 1665 //****************************************************************************** 1666 1666 // Internal callbacks uses by destructor 1667 intDestroyRects(LPVOID lpItem, DWORD dwRes)1667 INT CALLBACK DestroyRects(LPVOID lpItem, DWORD dwRes) 1668 1668 { 1669 1669 DDRectangle *pItem = (DDRectangle*) lpItem; … … 1672 1672 } 1673 1673 1674 intReleaseSurfaces(LPVOID lpItem, DWORD dwRes)1674 INT CALLBACK ReleaseSurfaces(LPVOID lpItem, DWORD dwRes) 1675 1675 { 1676 1676 OS2IDirectDrawSurface *pSurf; … … 1722 1722 { 1723 1723 DPA_DestroyCallback( DPA_LockedRects, 1724 (DPAENUMPROC)DestroyRects,1724 DestroyRects, 1725 1725 0); 1726 1726 } … … 1750 1750 { 1751 1751 DPA_DestroyCallback( DPA_SurfaceMipMaps, 1752 (DPAENUMPROC)ReleaseSurfaces,1752 ReleaseSurfaces, 1753 1753 0); 1754 1754 } … … 1757 1757 { 1758 1758 DPA_DestroyCallback( DPA_SurfaceAttached, 1759 (DPAENUMPROC)ReleaseSurfaces,1759 ReleaseSurfaces, 1760 1760 0); 1761 1761 } … … 2296 2296 { 2297 2297 delete pIRectDest; 2298 #ifdef DEBUG 2299 dprintf(("DDRAW: Blt: Dest Surface partly locked\n")); 2300 #endif 2298 dprintf(("DDRAW: Blt: Dest Surface partly locked\n")); 2301 2299 return(DDERR_SURFACEBUSY); 2302 2300 } … … 2380 2378 if(NULL==src) 2381 2379 { 2382 #ifdef DEBUG 2383 dprintf(("DDRAW: Unsupported sourceless FX operation. Flags = 0x%04X\n",dwFlags)); 2384 #endif 2380 dprintf(("DDRAW: Unsupported sourceless FX operation. Flags = 0x%04X\n",dwFlags)); 2381 2385 2382 return DD_OK; 2386 2383 } … … 2479 2476 { 2480 2477 delete pIRectSrc; 2481 #ifdef DEBUG 2482 dprintf(("DDRAW: Blt: Src Surface partly locked\n")); 2483 #endif 2478 dprintf(("DDRAW: Blt: Src Surface partly locked\n")); 2479 2484 2480 return(DDERR_SURFACEBUSY); 2485 2481 } … … 2489 2485 ( (NULL==lpSrcRect) && (NULL!=lpDestRect) ) ) 2490 2486 { 2491 #ifdef DEBUG 2492 dprintf(("DDRAW: Blitting with scaleing\n Not supported.\n")); 2493 #endif 2487 dprintf(("DDRAW: Blitting with scaleing\n Not supported.\n")); 2488 2494 2489 return DDERR_NOSTRETCHHW; 2495 2490 } … … 2994 2989 else 2995 2990 { 2991 // This will be be slow maybe move to ASM ? 2992 // using MMX should be much faster 2993 switch(dest->dwBytesPPDive) 2994 { 2995 case 1: 2996 while(BlitHeight--) 2997 { 2998 x = 0; 2999 while(x<BlitWidth) 3000 { 3001 if(pSrcPos[x] != (char) dwSrcColor) 3002 { 3003 pBltPos[x] = pSrcPos[x]; 3004 } 3005 x++; 3006 } 3007 pBltPos += dwPitch; 3008 pSrcPos += src->dwPitchDB; 3009 } 3010 break; 3011 case 2: 3012 while(BlitHeight--) 3013 { 3014 x = 0; 3015 while(x<BlitWidth) 3016 { 3017 if(((USHORT*)pSrcPos)[x] != (USHORT) dwSrcColor) 3018 { 3019 ((USHORT*)pBltPos)[x] = ((USHORT*)pSrcPos)[x]; 3020 } 3021 x++; 3022 } 3023 pBltPos += dwPitch; 3024 pSrcPos += src->dwPitchDB; 3025 } 3026 break; 3027 case 3: 3028 { 3029 char *pSC, *pDC; 3030 pSC = (char*)&dwSrcColor; 3031 pDC = (char*)&dwDestColor; 3032 BlitWidth *=3; 3033 3034 while(BlitHeight--) 3035 { 3036 x = 0; 3037 3038 while(x<BlitWidth) 3039 { 3040 if( (pSrcPos[x] != pSC[1]) && 3041 (pSrcPos[x+1] != pSC[2]) && 3042 (pSrcPos[x+2] != pSC[3]) 3043 ) 3044 { 3045 pBltPos[x] = pSrcPos[x]; 3046 pBltPos[x+1] = pSrcPos[x+2]; 3047 pBltPos[x+1] = pSrcPos[x+2]; 3048 } 3049 x +=3; 3050 } 3051 pBltPos += dwPitch; 3052 pSrcPos += src->dwPitchDB; 3053 } 3054 break; 3055 } 3056 case 4: 3057 while(BlitHeight--) 3058 { 3059 x = 0; 3060 while(x<BlitWidth) 3061 { 3062 if(((DWORD*)pSrcPos)[x] != dwSrcColor) 3063 { 3064 ((DWORD*)pBltPos)[x] = ((DWORD*)pSrcPos)[x]; 3065 } 3066 x++; 3067 } 3068 pBltPos += dwPitch; 3069 pSrcPos += src->dwPitchDB; 3070 } 3071 break; 3072 } // End switch 2996 3073 // Only Source colorkey 2997 3074 }
Note:
See TracChangeset
for help on using the changeset viewer.