- Timestamp:
- Jun 29, 2000, 11:28:36 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/ddraw/OS2SURFACE.CPP
r3161 r3777 1 /* $Id: OS2SURFACE.CPP,v 1.2 5 2000-03-18 21:17:58mike Exp $ */1 /* $Id: OS2SURFACE.CPP,v 1.26 2000-06-29 21:28:36 mike Exp $ */ 2 2 3 3 /* 4 * Direct /XSurface class implementaion4 * DirectDraw Surface class implementaion 5 5 * 6 6 * Copyright 1999 Markus Montkowski 7 * Copyright 2000 Michal Necasek 7 8 * 8 9 * Project Odin Software License can be found in LICENSE.TXT … … 302 303 303 304 #define CBM_CREATEDIB 0x02L /* create DIB bitmap */ 305 304 306 #ifdef DEBUG 305 306 307 // ****************************************************************************** 307 308 // * internal helper functions from WINE … … 536 537 _dump_DDPIXELFORMAT(pf->dwFlags); 537 538 dprintf(("DDRAW: dwFourCC : %ld\n", pf->dwFourCC)); 538 dprintf(("DDRAW: RBG bit c bout : %ld\n", pf->dwRGBBitCount));539 dprintf(("DDRAW: RBG bit count : %ld\n", pf->dwRGBBitCount)); 539 540 dprintf(("DDRAW: Masks : R %08lx G %08lx B %08lx A %08lx\n", 540 541 pf->dwRBitMask, pf->dwGBitMask, pf->dwBBitMask, pf->dwRGBAlphaBitMask)); … … 721 722 if(NULL==DPA_SurfaceMipMaps) 722 723 { 723 #ifdef DEBUG 724 dprintf(("DDRAW: Internal : Error creating DPA for MipMaps\n")); 725 #endif 724 dprintf(("DDRAW: Internal : Error creating DPA for MipMaps\n")); 726 725 lastError = DDERR_OUTOFMEMORY ; 727 726 return; … … 731 730 if(NULL==DPA_SurfaceAttached) 732 731 { 733 #ifdef DEBUG 734 dprintf(("DDRAW: Internal : Error creating DPA for attached surfaces\n")); 735 #endif 732 dprintf(("DDRAW: Internal : Error creating DPA for attached surfaces\n")); 736 733 lastError = DDERR_OUTOFMEMORY ; 737 734 return; … … 741 738 if(NULL==DPA_LockedRects) 742 739 { 743 #ifdef DEBUG 744 dprintf(("DDRAW: Internal : Error creating DPA for Locked Rectangles\n")); 745 #endif 740 dprintf(("DDRAW: Internal : Error creating DPA for Locked Rectangles\n")); 746 741 lastError = DDERR_OUTOFMEMORY ; 747 742 return; … … 751 746 if(NULL==DPA_SurfacePrivateData) 752 747 { 753 #ifdef DEBUG 754 dprintf(("DDRAW: Internal : Error creating DPA for priva surface Data\n")); 755 #endif 748 dprintf(("DDRAW: Internal : Error creating DPA for private surface Data\n")); 756 749 lastError = DDERR_OUTOFMEMORY ; 757 750 return; … … 784 777 break; 785 778 default: 786 dprintf(("DDRAW: Unsupported System ColorDe apth %d",lpDraw->dCaps.ulDepth));779 dprintf(("DDRAW: Unsupported System ColorDepth %d",lpDraw->dCaps.ulDepth)); 787 780 BltSolid = NULL; 788 781 ColorConv = NULL; … … 815 808 break; 816 809 default: 817 dprintf(("DDRAW: Unsupported System ColorDe apth %d",lpDraw->dCaps.ulDepth));810 dprintf(("DDRAW: Unsupported System ColorDepth %d",lpDraw->dCaps.ulDepth)); 818 811 BltSolid = NULL; 819 812 ColorConv = NULL; … … 846 839 break; 847 840 default: 848 dprintf(("DDRAW: Unsupported System ColorDe apth %d",lpDraw->dCaps.ulDepth));841 dprintf(("DDRAW: Unsupported System ColorDepth %d",lpDraw->dCaps.ulDepth)); 849 842 BltSolid = NULL; 850 843 ColorConv = NULL; … … 877 870 break; 878 871 default: 879 dprintf(("DDRAW: Unsupported System ColorDe apth %d",lpDraw->dCaps.ulDepth));872 dprintf(("DDRAW: Unsupported System ColorDepth %d",lpDraw->dCaps.ulDepth)); 880 873 BltSolid = NULL; 881 874 ColorConv = NULL; … … 885 878 break; 886 879 default: 887 dprintf(("DDRAW: Unsupported DX ColorDe apth %d",lpDraw->GetScreenBpp()));880 dprintf(("DDRAW: Unsupported DX ColorDepth %d",lpDraw->GetScreenBpp())); 888 881 BltSolid = NULL; 889 882 ColorConv = NULL; … … 902 895 if( surfaceType & DDSCAPS_PRIMARYSURFACE) 903 896 { 904 #ifdef DEBUG 905 dprintf(("DDRAW: Primary surface!\n")); 906 #endif 907 897 dprintf(("DDRAW: Primary surface!\n")); 908 898 if( lpDraw->HasPrimarySurface()) 909 899 { 910 #ifdef DEBUG 911 dprintf(("DDRAW: Primary surface already exits!\n")); 912 #endif 900 dprintf(("DDRAW: Primary surface already exits!\n")); 913 901 lastError = DDERR_PRIMARYSURFACEALREADYEXISTS; 914 902 return; … … 931 919 if( lpDraw->dCaps.ulDepth == lpDraw->GetScreenBpp() ) 932 920 { 933 dprintf(("DDRAW: Direct ScreenAccess possible\n"));921 dprintf(("DDRAW: Direct Screen Access possible\n")); 934 922 935 923 // Yes so direct access to framebuffer is possible … … 946 934 // and blit to the real framebuffer on Unlock to do color conversion 947 935 948 dprintf( ("Need Color convers ation %d => %d Bit\n",936 dprintf( ("Need Color conversion %d => %d Bit\n", 949 937 lpDraw->GetScreenBpp(), 950 938 lpDraw->dCaps.ulDepth … … 967 955 // Update passed in and local Surface description 968 956 969 #ifdef DEBUG 970 dprintf(("DDRAW: Setting up Surface\n")); 971 #endif 957 dprintf(("DDRAW: Setting up Surface\n")); 972 958 DDSurfaceDesc.dwFlags |= DDSD_WIDTH | DDSD_HEIGHT | 973 959 DDSD_PITCH | DDSD_LPSURFACE | … … 1063 1049 dprintf(("DDRAW: Unsupported Complex Surface\n")); 1064 1050 #ifdef DEBUG 1065 1051 _dump_DDSCAPS(DDSurfaceDesc.dwFlags); 1066 1052 #endif 1067 1053 lastError = DDERR_OUTOFMEMORY; … … 1419 1405 DWORD *pPal24; 1420 1406 WORD *pPal16; 1421 #ifdef DEBUG 1422 dprintf(("DDRAW: ColorFill with %08X\n", dwFillColor)); 1423 #endif 1407 dprintf(("DDRAW: ColorFill with %08X\n", dwFillColor)); 1424 1408 1425 1409 if(NULL!=lpDestRect) … … 1443 1427 //dprintf(("DDRAW: 0x%08X (%d/%d) at\n", pLine,FillWidth,FillHeight)); 1444 1428 1445 // Better safe th en sorry1446 if (FillHeight<=0)1429 // Better safe than sorry 1430 if (FillHeight <= 0) 1447 1431 return(DD_OK); 1448 1432 … … 1654 1638 break; 1655 1639 default: 1656 #ifdef DEBUG1657 1640 dprintf( ("Unexpected Screen Bitdepth %d\n", 1658 1641 lpDraw->dCaps.ulDepth)); 1659 #endif1660 1642 break; 1661 1643 } … … 1801 1783 else 1802 1784 { 1803 dprintf(("DDRAW: We are o e of many buffers\n"));1785 dprintf(("DDRAW: We are one of many buffers\n")); 1804 1786 DDSurfaceDesc.ddsCaps.dwCaps &= ~DDSCAPS_BACKBUFFER ; 1805 1787 DDSurfaceDesc.ddsCaps.dwCaps |= DDSCAPS_FLIP; … … 1833 1815 if(IsEqualGUID(riid, IID_IDirectDrawSurface)) 1834 1816 { 1835 *ppvObj = &me-> Vtbl2; // ToDo DO a real V1 table1817 *ppvObj = &me->lpVtbl; // ToDo DO a real V1 table 1836 1818 rc = DD_OK; 1837 1819 goto RetFn; … … 1839 1821 if(IsEqualGUID(riid, IID_IDirectDrawSurface2)) 1840 1822 { 1841 *ppvObj = &me-> Vtbl2;1823 *ppvObj = &me->lpVtbl2; 1842 1824 rc = DD_OK; 1843 1825 goto RetFn; … … 1870 1852 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 1871 1853 1872 #ifdef DEBUG 1873 dprintf(("DDRAW: OS2IDirectDrawSurface::SurfAddRef %d\n", me->Referenced+1)); 1874 #endif 1854 dprintf(("DDRAW: OS2IDirectDrawSurface::SurfAddRef %d\n", me->Referenced+1)); 1875 1855 1876 1856 return ++me->Referenced; … … 1882 1862 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 1883 1863 1884 #ifdef DEBUG 1885 dprintf(("DDRAW: OS2IDirectDrawSurface::SurfRelease %d\n", me->Referenced-1)); 1886 dprintf(("DDRAW: OS2IDirectDrawSurface::Surface %X\n", me)); 1887 #endif 1864 dprintf(("DDRAW: OS2IDirectDrawSurface::SurfRelease %d\n", me->Referenced-1)); 1865 dprintf(("DDRAW: OS2IDirectDrawSurface::Surface %X\n", me)); 1888 1866 if(me->Referenced) 1889 1867 { … … 1908 1886 { 1909 1887 1910 #ifdef DEBUG 1911 dprintf(("DDRAW: SurfAddAttachedSurface\n")); 1912 #endif 1888 dprintf(("DDRAW: SurfAddAttachedSurface\n")); 1913 1889 return SurfAddAttachedSurface4(This, (LPDIRECTDRAWSURFACE4)lpDDSurface); 1914 1890 } … … 1918 1894 { 1919 1895 1920 #ifdef DEBUG 1921 dprintf(("DDRAW: SurfAddAttachedSurface\n")); 1922 #endif 1896 dprintf(("DDRAW: SurfAddAttachedSurface\n")); 1923 1897 return SurfAddAttachedSurface4(This, (LPDIRECTDRAWSURFACE4)lpDDSurface); 1924 1898 } … … 1932 1906 int rc; 1933 1907 1934 #ifdef DEBUG 1935 dprintf(("DDRAW: SurfAddAttachedSurface4\n")); 1936 #endif 1908 dprintf(("DDRAW: SurfAddAttachedSurface4\n")); 1937 1909 1938 1910 if (NULL==lpDDSurface) … … 1943 1915 if(AttachedSurface->IsImplicitSurface()) 1944 1916 { 1945 #ifdef DEBUG 1946 dprintf(("DDRAW: Internal : Can't attach an implicit created surface to an other surface\n")); 1947 #endif 1917 dprintf(("DDRAW: Internal : Can't attach an implicitly created surface to another surface\n")); 1948 1918 return(DDERR_CANNOTATTACHSURFACE); 1949 1919 } … … 1951 1921 if(This == AttachedSurface) 1952 1922 { 1953 #ifdef DEBUG 1954 dprintf(("DDRAW: Can't attach an surface to itself\n")); 1955 #endif 1923 dprintf(("DDRAW: Can't attach a surface to itself\n")); 1956 1924 return(DDERR_CANNOTATTACHSURFACE); 1957 1925 } … … 1976 1944 else 1977 1945 { 1978 #ifdef DEBUG 1979 dprintf(("DDRAW: Internal : Error attaching to MipMap\n")); 1980 #endif 1946 dprintf(("DDRAW: Internal : Error attaching to MipMap\n")); 1981 1947 return(DDERR_CANNOTATTACHSURFACE); 1982 1948 } … … 1984 1950 else 1985 1951 { 1986 #ifdef DEBUG 1987 dprintf(("DDRAW: Target Surface isn't a MipMap\n")); 1988 #endif 1952 dprintf(("DDRAW: Target Surface isn't a MipMap\n")); 1989 1953 return(DDERR_CANNOTATTACHSURFACE); 1990 1954 } … … 2002 1966 else 2003 1967 { 2004 #ifdef DEBUG 2005 dprintf(("DDRAW: Internal : Error attaching to general Set\n")); 2006 #endif 1968 dprintf(("DDRAW: Internal : Error attaching to general Set\n")); 2007 1969 return(DDERR_CANNOTATTACHSURFACE); 2008 1970 } … … 2017 1979 ) 2018 1980 { 2019 #ifdef DEBUG 2020 dprintf(("DDRAW: Surfaces don't have same dimensions\n")); 2021 #endif 1981 dprintf(("DDRAW: Surfaces don't have equal dimensions\n")); 2022 1982 return(DDERR_CANNOTATTACHSURFACE); 2023 1983 } … … 2028 1988 if( (AttachedSurface->GetFrontBuffer()!=NULL) || (AttachedSurface->BackBuffer!= NULL)) 2029 1989 { 2030 #ifdef DEBUG 2031 dprintf(("DDRAW: Surfaces already has a front/backbuffer\n")); 2032 #endif 1990 dprintf(("DDRAW: Surface already has a front/backbuffer\n")); 2033 1991 return(DDERR_SURFACEALREADYATTACHED); 2034 1992 } … … 2063 2021 else 2064 2022 { 2065 #ifdef DEBUG 2066 dprintf(("DDRAW: Can't attach backbuffer to anything but a frontbuffer\n")); 2067 #endif 2068 return(DDERR_CANNOTATTACHSURFACE); 2023 dprintf(("DDRAW: Can't attach backbuffer to anything but a frontbuffer\n")); 2024 return(DDERR_CANNOTATTACHSURFACE); 2069 2025 } 2070 2026 } … … 2087 2043 else 2088 2044 { 2089 #ifdef DEBUG 2090 dprintf(("DDRAW: Internal : Error attaching to MipMap\n")); 2091 #endif 2045 dprintf(("DDRAW: Internal : Error attaching to MipMap\n")); 2092 2046 return(DDERR_CANNOTATTACHSURFACE); 2093 2047 } … … 2095 2049 else 2096 2050 { 2097 #ifdef DEBUG 2098 dprintf(("DDRAW: Tagget Surface isn't a MipMap\n")); 2099 #endif 2051 dprintf(("DDRAW: Target Surface isn't a MipMap\n")); 2100 2052 return(DDERR_CANNOTATTACHSURFACE); 2101 2053 } … … 2111 2063 else 2112 2064 { 2113 #ifdef DEBUG 2114 dprintf(("DDRAW: Internal : Error attaching to general Set\n")); 2115 #endif 2065 dprintf(("DDRAW: Internal : Error attaching to general Set\n")); 2116 2066 return(DDERR_CANNOTATTACHSURFACE); 2117 2067 } … … 2127 2077 HRESULT __stdcall SurfAddOverlayDirtyRect(THIS, LPRECT) 2128 2078 { 2129 #ifdef DEBUG 2130 dprintf(("DDRAW: SurfAddOverlayDirtyRect Not implemented by M$ in V 6.0! \n")); 2131 #endif 2079 dprintf(("DDRAW: SurfAddOverlayDirtyRect Not implemented by M$ in DX 6.0!\n")); 2132 2080 2133 2081 return(DD_OK); … … 2296 2244 { 2297 2245 delete pIRectDest; 2298 dprintf(("DDRAW: Blt: Dest Surface part ly locked\n"));2246 dprintf(("DDRAW: Blt: Dest Surface partially locked\n")); 2299 2247 return(DDERR_SURFACEBUSY); 2300 2248 } … … 2485 2433 ( (NULL==lpSrcRect) && (NULL!=lpDestRect) ) ) 2486 2434 { 2487 dprintf(("DDRAW: Blitting with scal eing\n Not supported.\n"));2435 dprintf(("DDRAW: Blitting with scaling\n Not supported.\n")); 2488 2436 2489 2437 return DDERR_NOSTRETCHHW; … … 3196 3144 HRESULT __stdcall SurfBltBatch(THIS, LPDDBLTBATCH, DWORD, DWORD ) 3197 3145 { 3198 #ifdef DEBUG 3199 dprintf(("DDRAW: SurfBltBatch Not implemented by M$\n")); 3200 #endif 3146 dprintf(("DDRAW: SurfBltBatch Not implemented by M$\n")); 3201 3147 3202 3148 return(DD_OK); … … 3251 3197 DWORD dwDestColor, dwSrcColor, BlitWidth, BlitHeight,x,y; 3252 3198 3253 #ifdef DEBUG 3254 dprintf(("DDRAW: SurfBltFast4 %08X at(%d/%d) onto %08X with flags %08X\n",src, dwX,dwY, dest, dwTrans)); 3255 #endif 3199 dprintf(("DDRAW: SurfBltFast4 %08X at(%d/%d) onto %08X with flags %08X\n",src, dwX,dwY, dest, dwTrans)); 3256 3200 3257 3201 if( (NULL==lpDDSrcSurface) || … … 3586 3530 { 3587 3531 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 3588 #ifdef DEBUG 3589 dprintf(("DDRAW: SurfDeleteAttachedSurface\n")); 3590 #endif 3532 dprintf(("DDRAW: SurfDeleteAttachedSurface\n")); 3591 3533 3592 3534 return(SurfDeleteAttachedSurface4(me, dwFlags, (LPDIRECTDRAWSURFACE4)lpDDSurface)); … … 3597 3539 { 3598 3540 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 3599 #ifdef DEBUG 3600 dprintf(("DDRAW: SurfDeleteAttachedSurface\n")); 3601 #endif 3541 dprintf(("DDRAW: SurfDeleteAttachedSurface\n")); 3602 3542 3603 3543 return(SurfDeleteAttachedSurface4(me, dwFlags, (LPDIRECTDRAWSURFACE4)lpDDSurface)); … … 3614 3554 3615 3555 BOOL Found = FALSE; 3616 #ifdef DEBUG 3617 dprintf(("DDRAW: SurfDeleteAttachedSurface\n")); 3618 #endif 3556 dprintf(("DDRAW: SurfDeleteAttachedSurface\n")); 3619 3557 3620 3558 if((0!=dwFlags)||(NULL==lpDDSurface)) … … 3756 3694 { 3757 3695 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 3758 #ifdef DEBUG 3759 dprintf(("DDRAW: SurfEnumAttachedSurfaces\n")); 3760 #endif 3696 dprintf(("DDRAW: SurfEnumAttachedSurfaces\n")); 3761 3697 3762 3698 return(SurfEnumAttachedSurfaces4(me,lpContext, (LPDDENUMSURFACESCALLBACK2) lpCallBack)); … … 3772 3708 HRESULT rc; 3773 3709 3774 #ifdef DEBUG 3775 dprintf(("DDRAW: SurfEnumAttachedSurfaces\n")); 3776 #endif 3710 dprintf(("DDRAW: SurfEnumAttachedSurfaces\n")); 3777 3711 if (NULL==lpCallBack) 3778 3712 return (DDERR_INVALIDPARAMS); … … 3942 3876 else 3943 3877 { 3944 #ifdef DEBUG 3945 dprintf(("DDRAW: Memory Flipchain")); 3946 #endif 3878 dprintf(("DDRAW: Memory Flipchain")); 3947 3879 // Memory Flipchain 3948 3880 // … … 3995 3927 { 3996 3928 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 3997 #ifdef DEBUG 3998 dprintf(("DDRAW: SurfGetAttachedSurface\n")); 3999 #endif 3929 dprintf(("DDRAW: SurfGetAttachedSurface\n")); 4000 3930 4001 3931 return(SurfGetAttachedSurface4(me, (LPDDSCAPS2)lpDDCaps , (LPDIRECTDRAWSURFACE4*)lpDDSurf)); … … 4007 3937 { 4008 3938 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 4009 #ifdef DEBUG 4010 dprintf(("DDRAW: SurfGetAttachedSurface3\n")); 4011 #endif 3939 dprintf(("DDRAW: SurfGetAttachedSurface3\n")); 4012 3940 4013 3941 return(SurfGetAttachedSurface4(me, (LPDDSCAPS2)lpDDCaps , (LPDIRECTDRAWSURFACE4*)lpDDSurf)); … … 4104 4032 HRESULT __stdcall SurfGetBltStatus(THIS This, DWORD) 4105 4033 { 4106 #ifdef DEBUG 4107 dprintf(("DDRAW: SurfGetBltStatus\n")); 4108 #endif 4034 dprintf(("DDRAW: SurfGetBltStatus\n")); 4109 4035 4110 4036 return(DD_OK); … … 4116 4042 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 4117 4043 4118 #ifdef DEBUG 4119 dprintf(("DDRAW: SurfGetCaps\n")); 4120 #endif 4044 dprintf(("DDRAW: SurfGetCaps\n")); 4121 4045 4122 4046 if(NULL==lpDDCaps) … … 4134 4058 { 4135 4059 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 4136 #ifdef DEBUG 4137 dprintf(("DDRAW: SurfGetCaps4\n")); 4138 #endif 4060 dprintf(("DDRAW: SurfGetCaps4\n")); 4139 4061 4140 4062 if(NULL==lpDDCaps) … … 4145 4067 _dump_DDSCAPS(lpDDCaps->dwCaps); 4146 4068 _dump_DDSCAPS2(lpDDCaps->dwCaps2); 4147 4148 4069 #endif 4149 4070 … … 4156 4077 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 4157 4078 4158 #ifdef DEBUG 4159 dprintf(("DDRAW: SurfGetClipper\n")); 4160 #endif 4079 dprintf(("DDRAW: SurfGetClipper\n")); 4161 4080 4162 4081 if(me->lpClipper) … … 4173 4092 { 4174 4093 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 4175 4176 #ifdef DEBUG4177 4094 dprintf(("DDRAW: SurfGetColorKey\n")); 4178 #endif4179 4095 4180 4096 if ((0==dwFlags) || (NULL==lpDDColKey)) … … 4205 4121 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 4206 4122 DDSURFACEDESC2 LockedSurfaceDesc; 4207 HRESULT rc; 4123 HRESULT rc; 4124 BITMAPINFOHEADER bmihHdr; 4208 4125 BITMAP bmpSurface; 4209 4126 struct … … 4213 4130 } BitmapInfo; 4214 4131 4215 #ifdef DEBUG 4216 dprintf(("DDRAW: SurfGetDC\n")); 4217 #endif 4218 4219 if (NULL==hdc) 4132 dprintf(("DDRAW: SurfGetDC\n")); 4133 4134 if (hdc == NULL) 4220 4135 return(DDERR_INVALIDPARAMS); 4221 4136 … … 4235 4150 if(me->hdcImage == NULL) 4236 4151 { 4237 #ifdef DEBUG 4238 dprintf(("DDRAW: Can't create compatible DC!\n")); 4239 #endif 4152 dprintf(("DDRAW: Can't create compatible DC!\n")); 4240 4153 me->Vtbl.Unlock(me,NULL); 4241 4154 rc = DDERR_GENERIC; 4242 4155 } 4243 InverseDC(me->hdcImage, LockedSurfaceDesc.dwHeight);4244 } 4245 4246 if( (DD_OK==rc) &&4247 (me->hbmImage == NULL) )4248 { 4156 } 4157 4158 if( (DD_OK==rc) && (me->hbmImage == NULL) ) 4159 { 4160 OS2IDirectDrawPalette *ddpal = NULL; 4161 4249 4162 dprintf( ("Trying to create Bitmap (%d/%d) at %d Bit\n", 4250 LockedSurfaceDesc. lPitch/ (LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount>>3),4163 LockedSurfaceDesc.dwWidth, 4251 4164 LockedSurfaceDesc.dwHeight, 4252 4165 LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount 4253 4166 )); 4254 #if 04167 #if 1 4255 4168 memset(&BitmapInfo, 0, sizeof(BitmapInfo)); 4256 BitmapInfo.bmiHead.biSize = sizeof(BITMAPINFOHEADER); 4257 BitmapInfo.bmiHead.biWidth = LockedSurfaceDesc.lPitch/ (LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount>>3); 4258 BitmapInfo.bmiHead.biHeight = LockedSurfaceDesc.dwHeight; 4259 BitmapInfo.bmiHead.biPlanes = 1; 4260 BitmapInfo.bmiHead.biBitCount = LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount; 4169 BitmapInfo.bmiHead.biSize = sizeof(BITMAPINFOHEADER); 4170 BitmapInfo.bmiHead.biWidth = LockedSurfaceDesc.dwWidth; 4171 BitmapInfo.bmiHead.biHeight = LockedSurfaceDesc.dwHeight; 4172 BitmapInfo.bmiHead.biPlanes = 1; 4173 BitmapInfo.bmiHead.biBitCount = LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount; 4174 memset(&bmihHdr, 0, sizeof(bmihHdr)); 4175 bmihHdr.biSize = sizeof(BITMAPINFOHEADER); 4176 bmihHdr.biWidth = LockedSurfaceDesc.dwWidth; 4177 bmihHdr.biHeight = LockedSurfaceDesc.dwHeight; 4178 bmihHdr.biPlanes = 1; 4179 bmihHdr.biBitCount = LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount; 4261 4180 #else 4262 4181 bmpSurface.bmType = 0; … … 4274 4193 break; 4275 4194 case 8: 4276 #if 04195 #if 1 4277 4196 BitmapInfo.bmiHead.biCompression = BI_RGB; 4278 GetSystemPaletteEntries(me->hdcImage,0,255,(PPALETTEENTRY)&BitmapInfo.bmiCols[0]); 4197 if (me->lpPalette != NULL) 4198 ddpal = me->lpPalette; 4199 if ((me->FrontBuffer != NULL) && (me->FrontBuffer->lpPalette != NULL)) 4200 ddpal = me->FrontBuffer->lpPalette; 4201 if (ddpal != NULL) { 4202 ddpal->Vtbl.GetEntries((IDirectDrawPalette*)ddpal, 4203 0, 0, 256, (PPALETTEENTRY)&BitmapInfo.bmiCols[0]); 4204 } 4205 else { 4206 dprintf(("DDRAW: Using default palette\n")); 4207 for (DWORD i = 0; i < 256; i++) { 4208 BitmapInfo.bmiCols[i].rgbBlue = DefaultPalette[i*3+2]; 4209 BitmapInfo.bmiCols[i].rgbGreen = DefaultPalette[i*3+1]; 4210 BitmapInfo.bmiCols[i].rgbRed = DefaultPalette[i*3]; 4211 BitmapInfo.bmiCols[i].rgbReserved = 0; 4212 } 4213 } 4279 4214 me->hbmImage = CreateDIBitmap( me->hdcImage, 4280 NULL,4281 CBM_ CREATEDIB,4215 &bmihHdr, 4216 CBM_INIT, 4282 4217 LockedSurfaceDesc.lpSurface, 4283 4218 (PBITMAPINFO)&BitmapInfo, … … 4300 4235 LockedSurfaceDesc.lpSurface, 4301 4236 (PBITMAPINFO)&BitmapInfo, 4302 DIB_RGB_COLORS );4237 DIB_RGB_COLORS ); 4303 4238 #else 4304 4239 bmpSurface.bmBitsPixel = 24; … … 4307 4242 break; 4308 4243 default: 4309 #ifdef DEBUG 4310 dprintf( ("Unexptected BitCount %d \n", 4244 dprintf( ("Unexpected BitCount %d \n", 4311 4245 LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount)); 4312 #endif4313 4246 me->hbmImage=NULL; 4314 4247 } // end switch (me->DDSurfaceDesc.ddpfPixelFormat.dwRGBBitCount) … … 4316 4249 if(me->hbmImage == NULL) 4317 4250 { 4318 #ifdef DEBUG 4319 dprintf(("DDRAW: Can't create bitmap!\n")); 4320 #endif 4251 dprintf(("DDRAW: Can't create bitmap!\n")); 4321 4252 DeleteDC(me->hdcImage); 4322 4253 me->hdcImage = NULL; … … 4327 4258 else 4328 4259 { 4329 if( (DD_OK==rc) && 4330 (me->dwLastDCUnique != me->dwUniqueValue) ) 4331 { 4332 #ifdef DEBUG 4333 dprintf(("DDRAW: The Surface was locked/unlocked after the last DC was created =>Update Bitmap!\n")); 4334 #endif 4260 if( (DD_OK==rc) && (me->dwLastDCUnique != me->dwUniqueValue) ) 4261 { 4262 dprintf(("DDRAW: The Surface was locked/unlocked after the last DC was created =>Update Bitmap!\n")); 4335 4263 4336 4264 memset(&BitmapInfo,0, sizeof(BitmapInfo)); 4337 4265 BitmapInfo.bmiHead.biSize = sizeof(BITMAPINFOHEADER); 4338 BitmapInfo.bmiHead.biWidth = LockedSurfaceDesc. lPitch/ (LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount>>3);4266 BitmapInfo.bmiHead.biWidth = LockedSurfaceDesc.dwWidth; 4339 4267 BitmapInfo.bmiHead.biHeight = LockedSurfaceDesc.dwHeight; 4340 4268 BitmapInfo.bmiHead.biPlanes = 1; … … 4367 4295 break; 4368 4296 default: 4369 #ifdef DEBUG 4370 dprintf(("DDRAW: Unexptected BitCount %d => Bitmap not updated!\n",LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount)); 4371 #endif 4297 dprintf(("DDRAW: Unexpected BitCount %d => Bitmap not updated!\n",LockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount)); 4372 4298 break; 4373 4299 } // end switch (me->DDSurfaceDesc.ddpfPixelFormat.dwRGBBitCount) … … 4378 4304 // Allways select the bitmap into the DC! No matter if the old or a new one 4379 4305 4380 if(DD_OK==rc) 4381 { 4382 if((me->hgdiOld = SelectObject(me->hdcImage, me->hbmImage)) == NULL) 4383 { 4384 #ifdef DEBUG 4385 dprintf(("DDRAW: Can't select bitmap into dc!\n")); 4386 #endif 4306 if (DD_OK==rc) 4307 { 4308 if ((me->hgdiOld = SelectObject(me->hdcImage, me->hbmImage)) == NULL) 4309 { 4310 dprintf(("DDRAW: Can't select bitmap into DC!\n")); 4387 4311 DeleteDC(me->hdcImage); 4388 4312 me->hdcImage = NULL; … … 4404 4328 HRESULT __stdcall SurfGetFlipStatus(THIS This, DWORD dwFlags) 4405 4329 { 4406 #ifdef DEBUG 4407 dprintf(("DDRAW: SurfGetFlipStatus\n")); 4408 #endif 4330 dprintf(("DDRAW: SurfGetFlipStatus\n")); 4409 4331 4410 4332 if( (DDGFS_CANFLIP!=dwFlags) && (DDGFS_ISFLIPDONE!=dwFlags) ) … … 4418 4340 { 4419 4341 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 4420 #ifdef DEBUG 4421 dprintf(("DDRAW: SurfGetOverlayPosition\n")); 4422 #endif 4342 dprintf(("DDRAW: SurfGetOverlayPosition\n")); 4423 4343 4424 4344 // Maybe simply return dderr_notsupported as we retun a max overlay value of 0 in the caps ? … … 4447 4367 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 4448 4368 4449 #ifdef DEBUG 4450 dprintf(("DDRAW: SurfGetPalette\n")); 4451 #endif 4369 dprintf(("DDRAW: SurfGetPalette\n")); 4452 4370 4453 4371 if(me->lpPalette) … … 4465 4383 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 4466 4384 4467 #ifdef DEBUG 4468 dprintf(("DDRAW: SurfGetPixelFormat\n")); 4469 #endif 4385 dprintf(("DDRAW: SurfGetPixelFormat\n")); 4470 4386 4471 4387 if(NULL==lpPixelFormat) … … 4484 4400 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 4485 4401 4486 #ifdef DEBUG 4487 dprintf(("DDRAW: SurfGetSurfaceDesc\n")); 4488 #endif 4402 dprintf(("DDRAW: SurfGetSurfaceDesc\n")); 4489 4403 4490 4404 if((lpSurface == NULL)||(lpSurface->dwSize != sizeof(DDSURFACEDESC)) ) … … 4503 4417 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 4504 4418 4505 #ifdef DEBUG 4506 dprintf(("DDRAW: SurfGetSurfaceDesc4\n")); 4507 #endif 4419 dprintf(("DDRAW: SurfGetSurfaceDesc4\n")); 4508 4420 4509 4421 if((lpSurface == NULL)||(lpSurface->dwSize != sizeof(DDSURFACEDESC2)) ) … … 4520 4432 HRESULT __stdcall SurfInitialize(THIS, LPDIRECTDRAW, LPDDSURFACEDESC) 4521 4433 { 4522 #ifdef DEBUG 4523 dprintf(("DDRAW: SurfInitialize\n")); 4524 #endif 4434 dprintf(("DDRAW: SurfInitialize\n")); 4525 4435 4526 4436 return(DDERR_ALREADYINITIALIZED); // Init is done during creation see M$ Doc … … 4530 4440 HRESULT __stdcall SurfInitialize4(THIS, LPDIRECTDRAW, LPDDSURFACEDESC2) 4531 4441 { 4532 #ifdef DEBUG 4533 dprintf(("DDRAW: SurfInitialize\n")); 4534 #endif 4442 dprintf(("DDRAW: SurfInitialize\n")); 4535 4443 4536 4444 return(DDERR_ALREADYINITIALIZED); // Init is done during creation see M$ Doc … … 4544 4452 // if they are preserved if switching to a FS DOS/OS2 session 4545 4453 // 4546 #ifdef DEBUG 4547 dprintf(("DDRAW: SurfIsLost\n")); 4548 #endif 4454 dprintf(("DDRAW: SurfIsLost\n")); 4549 4455 4550 4456 return(DD_OK); … … 4561 4467 HRESULT rc; 4562 4468 4563 #ifdef DEBUG 4564 dprintf(("DDRAW: SurfLock %d %08X %d %d\n", (int)lpRect, (int)lpSurfaceDesc, dwFlags, hEvent)); 4565 #endif 4469 dprintf(("DDRAW: SurfLock %d %08X %d %d\n", (int)lpRect, (int)lpSurfaceDesc, dwFlags, hEvent)); 4566 4470 4567 4471 if((NULL==lpSurfaceDesc)||(NULL!=hEvent)) … … 4606 4510 HRESULT rc; 4607 4511 4608 #ifdef DEBUG 4609 dprintf( ("SurfLock4 %08X %08X %08X %d %d\n", 4610 me, 4611 (int)lpRect, 4612 (int)lpSurfaceDesc, 4613 dwFlags, 4614 hEvent) ); 4615 #endif 4512 dprintf( ("SurfLock4 %08X %08X %08X %d %d\n", 4513 me, 4514 (int)lpRect, 4515 (int)lpSurfaceDesc, 4516 dwFlags, 4517 hEvent) ); 4616 4518 4617 4519 if( (NULL==lpSurfaceDesc) || … … 4641 4543 if (NULL==lpRect) 4642 4544 { 4643 // If anything is locked we can't lock ethe complete surface4644 dprintf(("DDRAW: Surface has locked Rectangles , and we want to completelock it\n"));4545 // If anything is locked we can't lock the complete surface 4546 dprintf(("DDRAW: Surface has locked Rectangles and we want to completely lock it\n")); 4645 4547 Found = TRUE; 4646 4548 } … … 4650 4552 // be locked so check for this 4651 4553 4652 dprintf(("DDRAW: Surface has locked Rectangles, check if the overlap\n"));4554 dprintf(("DDRAW: Surface has locked Rectangles, check if they overlap\n")); 4653 4555 4654 4556 i=0; … … 4672 4574 { 4673 4575 delete pIRectNew; 4674 #ifdef DEBUG 4675 dprintf(("DDRAW: SurfLock4: Surface already locked\n\n")); 4676 #endif 4576 dprintf(("DDRAW: SurfLock4: Surface already locked\n\n")); 4677 4577 rc = DDERR_SURFACEBUSY; 4678 4578 } … … 4689 4589 (lpRect->top * me->dwPitchFB) + 4690 4590 (lpRect->left * (lpSurfaceDesc->ddpfPixelFormat.dwRGBBitCount>>3))); 4691 #ifdef DEBUG 4692 dprintf(("DDRAW: SurfLock4 %08X (x,y) = (%d,%d)\n\n", lpSurfaceDesc->lpSurface, lpRect->top, lpRect->left)); 4693 #endif 4591 dprintf(("DDRAW: SurfLock4 %08X (x,y) = (%d,%d)\n\n", lpSurfaceDesc->lpSurface, lpRect->top, lpRect->left)); 4694 4592 } 4695 4593 else 4696 4594 { 4697 #ifdef DEBUG 4698 dprintf(("DDRAW: SurfLock4 %08X \n\n", lpSurfaceDesc->lpSurface)); 4699 #endif 4595 dprintf(("DDRAW: SurfLock4 %08X \n\n", lpSurfaceDesc->lpSurface)); 4700 4596 } 4701 4597 // Add the rectangle to the list of locked rectangles … … 4727 4623 int i,rc; 4728 4624 4729 #ifdef DEBUG 4730 dprintf(("DDRAW: SurfReleaseDC\n")); 4731 #endif 4625 dprintf(("DDRAW: SurfReleaseDC\n")); 4732 4626 4733 4627 if(hdc != me->hdcImage) … … 4759 4653 (PBITMAPINFO)&BitmapInfo, 4760 4654 DIB_RGB_COLORS); 4655 // BitmapInfo.bmiHead.biHeight = -BitmapInfo.bmiHead.biHeight; 4761 4656 dprintf( ("GetDIBits rc=%d\n Size :%d\n Width :%d\n Height :%d\n" 4762 4657 " Planes :%d\n BitCount :%d\nLastEror = %d\nPixel[0,0] = 0x%02X\n", … … 4769 4664 GetLastError(), 4770 4665 ((char*)me->DDSurfaceDesc.lpSurface)[0])); 4666 4771 4667 rc = GetDIBits( hdc, 4772 4668 me->hbmImage, … … 4797 4693 break; 4798 4694 default: 4799 #ifdef DEBUG 4800 dprintf(("DDRAW: Unexptected BitCount %d => Surface unlocked but no data copied back\n",me->DDSurfaceDesc.ddpfPixelFormat.dwRGBBitCount)); 4801 #endif 4695 dprintf(("DDRAW: Unexpected BitCount %d => Surface unlocked but no data copied back\n",me->DDSurfaceDesc.ddpfPixelFormat.dwRGBBitCount)); 4802 4696 // we might could keep the surface locked and return an error but this is more "safe" 4803 4697 break; … … 4824 4718 HRESULT __stdcall SurfRestore(THIS) 4825 4719 { 4826 #ifdef DEBUG 4827 dprintf(("DDRAW: SurfRestore\n")); 4828 #endif 4720 dprintf(("DDRAW: SurfRestore\n")); 4829 4721 4830 4722 return(DD_OK); … … 4836 4728 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 4837 4729 4838 #ifdef DEBUG 4839 dprintf(("DDRAW: SurfSetClipper\n")); 4840 #endif 4730 dprintf(("DDRAW: SurfSetClipper\n")); 4841 4731 4842 4732 if(lpClipper == NULL) … … 4925 4815 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 4926 4816 4927 #ifdef DEBUG 4928 dprintf(("DDRAW: SurfSetOverlayPosition\n")); 4929 #endif 4817 dprintf(("DDRAW: SurfSetOverlayPosition\n")); 4930 4818 4931 4819 if( (me->DDSurfaceDesc.dwFlags & DDSD_CAPS) && … … 4954 4842 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 4955 4843 4956 #ifdef DEBUG 4957 dprintf(("DDRAW: SurfSetPalette\n")); 4958 #endif 4844 dprintf(("DDRAW: SurfSetPalette\n")); 4959 4845 4960 4846 if(lpPalette == NULL) … … 5017 4903 HRESULT rc; 5018 4904 5019 #ifdef DEBUG 5020 dprintf(("DDRAW: SurfUnlock at %08X\n",lpSurfaceData)); 5021 #endif 4905 dprintf(("DDRAW: SurfUnlock at %08X\n",lpSurfaceData)); 5022 4906 5023 4907 if(me->fLocked == FALSE) 5024 4908 { 5025 #ifdef DEBUG 5026 dprintf(("DDRAW: Surface not locked!\n")); 5027 #endif 4909 dprintf(("DDRAW: Surface not locked!\n")); 5028 4910 return(DDERR_NOTLOCKED); 5029 4911 } 5030 5031 #ifdef DEBUG5032 dprintf(("DDRAW: Start Emuneration of Locked Rects\n"));5033 #endif5034 4912 5035 4913 i=0; … … 5041 4919 // this pointer in the locked rects DPA to unlock the right rect. 5042 4920 5043 while(i <DPA_GetPtrCount(me->DPA_LockedRects) && !Found)4921 while(i < DPA_GetPtrCount(me->DPA_LockedRects) && !Found) 5044 4922 { 5045 4923 pIRectEnum = (DDRectangle*)DPA_FastGetPtr(me->DPA_LockedRects,i); … … 5055 4933 if(!Found) 5056 4934 { 5057 #ifdef DEBUG 5058 dprintf(("DDRAW: Not Found, try Next rect\n")); 5059 #endif 4935 dprintf(("DDRAW: Not Found, try Next rect\n")); 5060 4936 i++; 5061 4937 } 5062 #ifdef DEBUG5063 4938 else 5064 4939 { 5065 4940 dprintf(("DDRAW: Found Rect\n")); 5066 4941 } 5067 #endif5068 4942 } 5069 4943 } … … 5090 4964 if(!Found) 5091 4965 { 5092 #ifdef DEBUG 5093 dprintf(("DDRAW: Not Found, try Next rect\n")); 5094 #endif 4966 dprintf(("DDRAW: Not Found, try Next rect\n")); 5095 4967 i++; 5096 4968 } 5097 #ifdef DEBUG5098 4969 else 5099 4970 { 5100 4971 dprintf(("DDRAW: Found Rect\n")); 5101 4972 } 5102 #endif5103 4973 } 5104 4974 delete pIRectUnlock; … … 5107 4977 if(!Found) 5108 4978 { 5109 #ifdef DEBUG 5110 dprintf(("DDRAW: Rectangle not locked, wrong Rect!\n\n")); 5111 #endif 4979 dprintf(("DDRAW: Rectangle not locked, wrong Rect!\n\n")); 5112 4980 rc = DDERR_INVALIDRECT; 5113 4981 } 5114 4982 else 5115 4983 { 5116 #ifdef DEBUG 5117 dprintf(("DDRAW: Remove Rect %d from Seq.\n",i)); 5118 #endif 4984 dprintf(("DDRAW: Remove Rect %d from Seq.\n",i)); 5119 4985 5120 4986 DPA_DeletePtr(me->DPA_LockedRects,i); 5121 4987 5122 #ifdef DEBUG 5123 dprintf(("DDRAW: Test if locked Rects main\n")); 5124 #endif 4988 dprintf(("DDRAW: Test if locked Rects main\n")); 5125 4989 5126 4990 if(0==DPA_GetPtrCount(me->DPA_LockedRects)) // Do we have unlocked last rectangle 5127 4991 { 5128 #ifdef DEBUG 5129 dprintf(("DDRAW: No Locked Rects left for surface\n")); 5130 #endif 4992 dprintf(("DDRAW: No Locked Rects left for surface\n")); 5131 4993 me->fLocked = FALSE; 5132 4994 } … … 5139 5001 if(me->pFrameBuffer != me->pDiveBuffer) 5140 5002 { 5141 #ifdef DEBUG 5142 dprintf(( "ColorConversion Needed %08X != %08X\n", 5143 me->pFrameBuffer, 5144 me->pDiveBuffer)); 5145 #endif 5003 dprintf(( "ColorConversion Needed %08X != %08X\n", 5004 me->pFrameBuffer, 5005 me->pDiveBuffer)); 5146 5006 if(NULL!=lpSurfaceData) 5147 5007 { … … 5158 5018 } 5159 5019 } 5160 #ifdef DEBUG5161 5020 else 5162 5021 dprintf( ("No ColorConversion Needed")); 5163 #endif5164 5022 5165 5023 // delete tne DDRectobject of the found rectangle … … 5193 5051 HRESULT rc; 5194 5052 5195 #ifdef DEBUG 5196 dprintf(("DDRAW: SurfUnlock4\n")); 5197 #endif 5053 dprintf(("DDRAW: SurfUnlock4\n")); 5198 5054 5199 5055 if(me->fLocked == FALSE) 5200 5056 { 5201 #ifdef DEBUG 5202 dprintf(("DDRAW: Surface not locked!\n")); 5203 #endif 5057 dprintf(("DDRAW: Surface not locked!\n")); 5204 5058 return(DDERR_NOTLOCKED); 5205 5059 } … … 5225 5079 pIRectUnlock->Right() )); 5226 5080 5227 #ifdef DEBUG 5228 dprintf(("DDRAW: Start Emuneration of Locked Rects\n")); 5229 #endif 5081 dprintf(("DDRAW: Start Enumeration of Locked Rects\n")); 5230 5082 5231 5083 i=0; … … 5242 5094 if(!Found) 5243 5095 { 5244 #ifdef DEBUG 5245 dprintf(("DDRAW: Not Found, try Next rect\n")); 5246 #endif 5096 dprintf(("DDRAW: Not Found, try Next rect\n")); 5247 5097 i++; 5248 5098 } 5249 #ifdef DEBUG5250 5099 else 5251 5100 { 5252 5101 dprintf(("DDRAW: Found Rect\n")); 5253 5102 } 5254 #endif5255 5103 } 5256 5104 … … 5260 5108 if(NULL==lpSurfaceRect) 5261 5109 { 5262 #ifdef DEBUG 5263 dprintf(("DDRAW: Rectangle not locked, wrong Rect!\n\n")); 5264 #endif 5110 dprintf(("DDRAW: Rectangle not locked, wrong Rect!\n\n")); 5265 5111 return(DDERR_INVALIDRECT); 5266 5112 } … … 5270 5116 else 5271 5117 { 5272 #ifdef DEBUG 5273 dprintf(("DDRAW: Remove Rect from Seq.\n")); 5274 #endif 5118 dprintf(("DDRAW: Remove Rect from Seq.\n")); 5275 5119 5276 5120 DPA_DeletePtr(me->DPA_LockedRects,i); … … 5278 5122 if(0==DPA_GetPtrCount(me->DPA_LockedRects)) // Do we have unlocked last rectangle 5279 5123 { 5280 #ifdef DEBUG 5281 dprintf(("DDRAW: No Locked Rects left for surface\n")); 5282 #endif 5124 dprintf(("DDRAW: No Locked Rects left for surface\n")); 5283 5125 me->fLocked = FALSE; 5284 5126 } … … 5286 5128 if(me->pFrameBuffer != me->pDiveBuffer) 5287 5129 { 5288 #ifdef DEBUG 5289 dprintf(( "ColorConversion Needed %08X != %08X\n", 5290 me->pFrameBuffer, 5291 me->pDiveBuffer)); 5292 #endif 5130 dprintf(( "ColorConversion Needed %08X != %08X\n", 5131 me->pFrameBuffer, 5132 me->pDiveBuffer)); 5293 5133 me->ColorConversion(lpSurfaceRect); 5294 5134 } … … 5306 5146 HRESULT __stdcall SurfUpdateOverlay(THIS This, LPRECT, LPDIRECTDRAWSURFACE2,LPRECT,DWORD, LPDDOVERLAYFX) 5307 5147 { 5308 #ifdef DEBUG 5309 dprintf(("DDRAW: SurfUpdateOverlay\n")); 5310 #endif 5148 dprintf(("DDRAW: SurfUpdateOverlay\n")); 5311 5149 return(DD_OK); 5312 5150 } … … 5315 5153 HRESULT __stdcall SurfUpdateOverlay3(THIS This, LPRECT, LPDIRECTDRAWSURFACE3,LPRECT,DWORD, LPDDOVERLAYFX) 5316 5154 { 5317 #ifdef DEBUG 5318 dprintf(("DDRAW: SurfUpdateOverlay\n")); 5319 #endif 5155 dprintf(("DDRAW: SurfUpdateOverlay\n")); 5320 5156 return(DD_OK); 5321 5157 } … … 5324 5160 HRESULT __stdcall SurfUpdateOverlay4(THIS, LPRECT, LPDIRECTDRAWSURFACE4,LPRECT,DWORD, LPDDOVERLAYFX) 5325 5161 { 5326 #ifdef DEBUG 5327 dprintf(("DDRAW: SurfUpdateOverlay\n")); 5328 #endif 5162 dprintf(("DDRAW: SurfUpdateOverlay\n")); 5329 5163 return(DD_OK); 5330 5164 } … … 5333 5167 HRESULT __stdcall SurfUpdateOverlayDisplay(THIS, DWORD) 5334 5168 { 5335 #ifdef DEBUG 5336 dprintf(("DDRAW: SurfUpdateOverlayDisplay\n")); 5337 #endif 5169 dprintf(("DDRAW: SurfUpdateOverlayDisplay\n")); 5338 5170 return(DD_OK); 5339 5171 } … … 5342 5174 HRESULT __stdcall SurfUpdateOverlayZOrder(THIS, DWORD, LPDIRECTDRAWSURFACE2) 5343 5175 { 5344 #ifdef DEBUG 5345 dprintf(("DDRAW: SurfUpdateOverlayZOrder\n")); 5346 #endif 5176 dprintf(("DDRAW: SurfUpdateOverlayZOrder\n")); 5347 5177 return(DD_OK); 5348 5178 } … … 5351 5181 HRESULT __stdcall SurfUpdateOverlayZOrder3(THIS, DWORD, LPDIRECTDRAWSURFACE3) 5352 5182 { 5353 #ifdef DEBUG 5354 dprintf(("DDRAW: SurfUpdateOverlayZOrder\n")); 5355 #endif 5183 dprintf(("DDRAW: SurfUpdateOverlayZOrder\n")); 5356 5184 return(DD_OK); 5357 5185 } … … 5360 5188 HRESULT __stdcall SurfUpdateOverlayZOrder4(THIS, DWORD, LPDIRECTDRAWSURFACE4) 5361 5189 { 5362 #ifdef DEBUG 5363 dprintf(("DDRAW: SurfUpdateOverlayZOrder4\n")); 5364 #endif 5190 dprintf(("DDRAW: SurfUpdateOverlayZOrder4\n")); 5365 5191 return(DD_OK); 5366 5192 } … … 5371 5197 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 5372 5198 5373 #ifdef DEBUG 5374 dprintf(("DDRAW: SurfGetDDInterface\n")); 5375 #endif 5199 dprintf(("DDRAW: SurfGetDDInterface\n")); 5376 5200 *lplpDirectDraw = (LPVOID FAR *)me->lpDraw; 5377 5201 return(DD_OK); … … 5384 5208 // If we implement this for the None dive buffers with a pdd the we must change 5385 5209 // from malloc to DosAllocMem and use OBJ_TILE flag 5386 #ifdef DEBUG 5387 dprintf(("DDRAW: SurfPageLock\n")); 5388 #endif 5210 dprintf(("DDRAW: SurfPageLock\n")); 5389 5211 return(DD_OK); 5390 5212 } … … 5393 5215 HRESULT __stdcall SurfPageUnlock(THIS, DWORD) 5394 5216 { 5395 #ifdef DEBUG 5396 dprintf(("DDRAW: SurfPageUnlock\n")); 5397 #endif 5217 dprintf(("DDRAW: SurfPageUnlock\n")); 5398 5218 return(DD_OK); 5399 5219 } … … 5404 5224 HRESULT __stdcall SurfSetSurfaceDesc(THIS This, LPDDSURFACEDESC lpSurfDesc, DWORD dwFlags) 5405 5225 { 5406 #ifdef DEBUG 5407 dprintf(("DDRAW: SurfSetSurfaceDesc\n")); 5408 #endif 5226 dprintf(("DDRAW: SurfSetSurfaceDesc\n")); 5409 5227 5410 5228 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; … … 5451 5269 HRESULT __stdcall SurfSetSurfaceDesc4(THIS This, LPDDSURFACEDESC2 lpSurfDesc, DWORD dwFlags) 5452 5270 { 5453 #ifdef DEBUG 5454 dprintf(("DDRAW: SurfSetSurfaceDesc4\n")); 5455 #endif 5271 dprintf(("DDRAW: SurfSetSurfaceDesc4\n")); 5456 5272 5457 5273 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; … … 5509 5325 HRESULT rc; 5510 5326 5511 #ifdef DEBUG 5512 dprintf(("DDRAW: SurfSetPrivateData\n")); 5513 #endif 5327 dprintf(("DDRAW: SurfSetPrivateData\n")); 5514 5328 5515 5329 if(NULL==me) … … 5692 5506 BOOL bFound = FALSE; 5693 5507 5694 #ifdef DEBUG 5695 dprintf(("DDRAW: SurfGetPrivateData\n")); 5696 #endif 5508 dprintf(("DDRAW: SurfGetPrivateData\n")); 5697 5509 5698 5510 if(NULL==me) … … 5752 5564 BOOL bFound = FALSE; 5753 5565 5754 #ifdef DEBUG 5755 dprintf(("DDRAW: SurfFreePrivateData\n")); 5756 #endif 5566 dprintf(("DDRAW: SurfFreePrivateData\n")); 5757 5567 5758 5568 if(NULL==me) … … 5797 5607 HRESULT __stdcall SurfGetUniquenessValue(THIS This, LPDWORD lpValue) 5798 5608 { 5799 #ifdef DEBUG 5800 dprintf(("DDRAW: SurfGetUniquenessValue\n")); 5801 #endif 5609 dprintf(("DDRAW: SurfGetUniquenessValue\n")); 5802 5610 OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This; 5803 5611 if (NULL==lpValue) … … 5816 5624 5817 5625 5818 #ifdef DEBUG 5819 dprintf(("DDRAW: SurfChangeUniquenessValue\n")); 5820 #endif 5626 dprintf(("DDRAW: SurfChangeUniquenessValue\n")); 5821 5627 me->dwUniqueValue++; 5822 5628
Note:
See TracChangeset
for help on using the changeset viewer.